Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding win_groupadd unit test case. #24207

Merged
merged 2 commits into from
Jul 1, 2015

Conversation

jayeshka
Copy link

Implemented win_groupadd_test unit test case.

@jayeshka
Copy link
Author

Lot many changes on 2015.5 branch.
Will fix this first.

@jfindlay jfindlay added the pending-changes The pull request needs additional changes before it can be merged label May 28, 2015
@jfindlay
Copy link
Contributor

@jayeshka, while we can't mock modules using patch, unit tests that rely on external libraries should be written as if that library is available because if you don't use patch and the way that python unittest works, replacing an object for a test will persist beyond the scope of that test. Instead you may do something like

...
try:
    import win_lib
    HAS_WIN_LIB = True
except ImportError:
    HAS_WIN_LIB = False
...
@skipIf(not HAS_WIN_LIB, 'these tests can only run with win_lib installed')
class WinLibTestCase(TestCase):
...

Is it possible for you to rewrite this test in this case? I think it should be mostly just removing the mock classes and adding the necessary imports. Thanks.

@jayeshka
Copy link
Author

jayeshka commented Jun 3, 2015

Will fix this.
Thanks @jfindlay

@jfindlay jfindlay added the Tests label Jun 3, 2015
@jfindlay jfindlay self-assigned this Jun 30, 2015
@jfindlay jfindlay merged commit 9b9aeb8 into saltstack:2015.5 Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-changes The pull request needs additional changes before it can be merged Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants