Skip to content

Instantly share code, notes, and snippets.

@moshez
Created March 20, 2015 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moshez/6513b2f55211defcf9f4 to your computer and use it in GitHub Desktop.
Save moshez/6513b2f55211defcf9f4 to your computer and use it in GitHub Desktop.
Patch for thing
(env)moshez@mcgyver:~/src/ncolony$ git diff -r 196c8dd
diff --git a/ncolony/tests/test_ctllib.py b/ncolony/tests/test_ctllib.py
index 5ff4514..b9a24cf 100644
--- a/ncolony/tests/test_ctllib.py
+++ b/ncolony/tests/test_ctllib.py
@@ -70,6 +70,16 @@ class TestArgParsing(unittest.TestCase):
self.assertEquals(res.gid, 6)
self.assertIs(res.func, ctllib.add)
+ def test_port(self):
+ res = self.parser.parse_args(self.base+['add', 'hello', '--cmd', '/bin/echo',
+ '--arg', 'hello', '--arg-port'])
+ self.assertEquals(res.name, 'hello')
+ self.assertEquals(res.cmd, '/bin/echo')
+ hello, port = res.args
+ self.assertEquals(hello, 'hello')
+ self.assertIsInstance(port, ctllib.Port)
+ self.assertEquals(port.idx, 0)
+
def test_remove(self):
"""Check remove subcommand parsing"""
res = self.parser.parse_args(self.base+['remove', 'hello'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment