extend test
This commit is contained in:
@@ -128,11 +128,12 @@ class TestMockDecoration:
|
|||||||
return "mock_basename"
|
return "mock_basename"
|
||||||
@mock.patch("os.path.abspath")
|
@mock.patch("os.path.abspath")
|
||||||
@mock.patch("os.path.normpath")
|
@mock.patch("os.path.normpath")
|
||||||
@mock.patch("os.path.basename",new=mock_basename)
|
@mock.patch("os.path.basename", new=mock_basename)
|
||||||
def test_someting(normpath, abspath, tmpdir):
|
def test_someting(normpath, abspath, tmpdir):
|
||||||
abspath.return_value = "this"
|
abspath.return_value = "this"
|
||||||
os.path.normpath(os.path.abspath("hello"))
|
os.path.normpath(os.path.abspath("hello"))
|
||||||
normpath.assert_any_call("this")
|
normpath.assert_any_call("this")
|
||||||
|
assert os.path.basename("123") == "mock_basename"
|
||||||
""")
|
""")
|
||||||
reprec = testdir.inline_run()
|
reprec = testdir.inline_run()
|
||||||
reprec.assertoutcome(passed=2)
|
reprec.assertoutcome(passed=2)
|
||||||
|
|||||||
1
tox.ini
1
tox.ini
@@ -7,6 +7,7 @@ changedir=testing
|
|||||||
commands= py.test --lsof -rfsxX --junitxml={envlogdir}/junit-{envname}.xml []
|
commands= py.test --lsof -rfsxX --junitxml={envlogdir}/junit-{envname}.xml []
|
||||||
deps=
|
deps=
|
||||||
nose
|
nose
|
||||||
|
mock
|
||||||
|
|
||||||
[testenv:genscript]
|
[testenv:genscript]
|
||||||
changedir=.
|
changedir=.
|
||||||
|
|||||||
Reference in New Issue
Block a user