예제 #1
0
 def test_bridge_with_no_default(self):
   bridge = Bridge([self.one, self.two, self.three])
   assert bridge.execute(['test', 'one']) == 1
   assert bridge.execute(['test', 'two']) == 1
   assert bridge.execute(['test', 'three']) == 1
   assert bridge.execute(['test', 'four']) == 2
   assert bridge.execute(['test', 'five']) == 2
   assert bridge.execute(['test', 'six']) == '3[six]'
   self.assertRaises(SystemExit, bridge.execute, ['test', 'seven'])
예제 #2
0
 def test_bridge_with_default_one(self):
     bridge = Bridge([self.one, self.two, self.three], default=self.one)
     assert bridge.execute(['test', 'one']) == 1
     assert bridge.execute(['test', 'two']) == 1
     assert bridge.execute(['test', 'three']) == 1
     assert bridge.execute(['test', 'four']) == 2
     assert bridge.execute(['test', 'five']) == 2
     assert bridge.execute(['test', 'six']) == '3[six]'
     assert bridge.execute(['test', 'seven']) == 1
     assert bridge.execute(['test', 'eight']) == 1
예제 #3
0
 def test_bridge_with_no_default(self):
     bridge = Bridge([self.one, self.two, self.three])
     assert bridge.execute(['test', 'one']) == 1
     assert bridge.execute(['test', 'two']) == 1
     assert bridge.execute(['test', 'three']) == 1
     assert bridge.execute(['test', 'four']) == 2
     assert bridge.execute(['test', 'five']) == 2
     assert bridge.execute(['test', 'six']) == '3[six]'
     self.assertRaises(SystemExit, bridge.execute, ['test', 'seven'])
예제 #4
0
 def test_bridge_with_default_one(self):
   bridge = Bridge([self.one, self.two, self.three], default=self.one)
   assert bridge.execute(['test', 'one']) == 1
   assert bridge.execute(['test', 'two']) == 1
   assert bridge.execute(['test', 'three']) == 1
   assert bridge.execute(['test', 'four']) == 2
   assert bridge.execute(['test', 'five']) == 2
   assert bridge.execute(['test', 'six']) == '3[six]'
   assert bridge.execute(['test', 'seven']) == 1
   assert bridge.execute(['test', 'eight']) == 1
예제 #5
0
 def test_bridge_ordering(self):
   bridge1 = Bridge([self.one, self.two, self.three])
   bridge2 = Bridge([self.two, self.one, self.three])
   assert bridge1.execute(['test', 'three']) == 1
   assert bridge2.execute(['test', 'three']) == 2
예제 #6
0
def proxy_main():
  v2 = AuroraClientV2CommandProcessor()
  v1 = AuroraClientV1CommandProcessor()
  bridge = Bridge([v2, v1], default=v1)
  bridge.execute(sys.argv)
예제 #7
0
def proxy_main():
    v2 = AuroraClientV2CommandProcessor()
    v1 = AuroraClientV1CommandProcessor()
    bridge = Bridge([v2, v1], default=v1)
    bridge.execute(sys.argv)
예제 #8
0
 def test_bridge_ordering(self):
     bridge1 = Bridge([self.one, self.two, self.three])
     bridge2 = Bridge([self.two, self.one, self.three])
     assert bridge1.execute(['test', 'three']) == 1
     assert bridge2.execute(['test', 'three']) == 2