Page MenuHomeDevCentral

Allow to resolve __salt__ in rust module tests
ClosedPublic

Authored by dereckson on Mar 7 2022, 19:35.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 29, 05:39
Unknown Object (File)
Sat, Sep 28, 14:20
Unknown Object (File)
Wed, Sep 25, 10:41
Unknown Object (File)
Mon, Sep 23, 00:24
Unknown Object (File)
Sat, Sep 14, 09:10
Unknown Object (File)
Mon, Sep 9, 13:52
Unknown Object (File)
Mon, Sep 9, 13:38
Unknown Object (File)
Fri, Sep 6, 18:22
Subscribers
None

Details

Summary

Fixes the following issue:

======================================================================
ERROR: test_get_rustc_triplet (test_rust.Testinstance)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/salt/nasqueron-operations/_tests/modules/test_rust.py", line 11, in test_get_rustc_triplet
    triplet = rust.get_rustc_triplet()
  File "../_modules/rust.py", line 35, in get_rustc_triplet
    return __salt__["cmd.shell"]("rustc -vV | sed -ne 's/^host: //p'")
NameError: name '__salt__' is not defined
Test Plan

make test

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.
This revision is now accepted and ready to land.Mar 7 2022, 19:36
$ cd _tests
$ ./modules/test_rust.py
<frozen importlib._bootstrap>:283: DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead
.
----------------------------------------------------------------------
Ran 1 test in 0.108s

OK