Rfaulk has uploaded a new change for review.
https://gerrit.wikimedia.org/r/62957
Change subject: fixes. rename non-test methods in test.py / ensure deploy dir
exists / fix config.
......................................................................
fixes. rename non-test methods in test.py / ensure deploy dir exists / fix
config.
Change-Id: I076a689228f70cf018aba7b7735ab703e789f2dd
---
M sartoris/sartoris.py
M sartoris/tests/test.py
2 files changed, 17 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/sartoris refs/changes/57/62957/1
diff --git a/sartoris/sartoris.py b/sartoris/sartoris.py
index e4f805c..c20e246 100755
--- a/sartoris/sartoris.py
+++ b/sartoris/sartoris.py
@@ -141,6 +141,10 @@
def __init__(self, *args, **kwargs):
""" Initialize class instance """
self.__class__.__instance = self
+
+ if not os.path.exists(self.DEPLOY_DIR):
+ os.mkdir(self.DEPLOY_DIR)
+
self._configure()
self._tag = None # Stores tag state
@@ -159,7 +163,7 @@
proc = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- self.config['top_dir'] = proc.communicate()[0]
+ self.config['top_dir'] = proc.communicate()[0].strip()
if proc.returncode != 0:
exit_code = 20
diff --git a/sartoris/tests/test.py b/sartoris/tests/test.py
index ed5e40f..9a228e1 100644
--- a/sartoris/tests/test.py
+++ b/sartoris/tests/test.py
@@ -16,21 +16,21 @@
from shutil import rmtree
-def tester_deco(test_method):
+def setup_deco(test_method):
"""
Performs setup and teardown calls for all tests to decouple the state if
the repo from this testing module.
"""
- def tester_wrap(self):
- init_test_repo()
+ def setup_wrap(self):
+ init_tmp_repo()
try:
test_method(self)
finally:
- teardown_test_repo()
- return tester_wrap
+ teardown_tmp_repo()
+ return setup_wrap
-def init_test_repo():
+def init_tmp_repo():
"""
Create a test repo, change to directory
"""
@@ -39,7 +39,7 @@
chdir(config.TEST_REPO)
-def teardown_test_repo():
+def teardown_tmp_repo():
"""
Remove the test repo
"""
@@ -85,7 +85,7 @@
class TestSartorisFunctionality(unittest.TestCase):
- @tester_deco
+ @setup_deco
def test_abort(self):
"""
abort - test to ensure that ``abort`` method functions
@@ -146,7 +146,7 @@
except SartorisError:
assert False
- @tester_deco
+ @setup_deco
def test_show_tag(self):
"""
start - test to ensure that start method functions
@@ -161,7 +161,7 @@
except SartorisError:
assert False
- @tester_deco
+ @setup_deco
def test_start(self):
"""
start - test to ensure that ``start`` method functions
@@ -173,7 +173,7 @@
except SartorisError:
assert False
- @tester_deco
+ @setup_deco
def test_sync(self):
"""
sync - test to ensure that ``sync`` method functions
@@ -188,7 +188,7 @@
except SartorisError:
assert False
- @tester_deco
+ @setup_deco
def test_deploy_in_progress(self):
"""
deploy_in_progress - test to ensure that when the ``start`` method
--
To view, visit https://gerrit.wikimedia.org/r/62957
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I076a689228f70cf018aba7b7735ab703e789f2dd
Gerrit-PatchSet: 1
Gerrit-Project: sartoris
Gerrit-Branch: master
Gerrit-Owner: Rfaulk <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits