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, Feb 2, 23:46
Unknown Object (File)
Sat, Feb 1, 21:38
Unknown Object (File)
Sat, Feb 1, 21:38
Unknown Object (File)
Sat, Feb 1, 20:50
Unknown Object (File)
Sat, Feb 1, 20:19
Unknown Object (File)
Sat, Feb 1, 04:26
Unknown Object (File)
Sat, Feb 1, 03:20
Unknown Object (File)
Sat, Feb 1, 02:15
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 Passed
Unit
No Test Coverage
Branch
mock
Build Status
Buildable 4034
Build 4286: arc lint + arc unit

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