Beispiel #1
0
    def test_1(self):
        self.add('a', nargs='+', type=int)
        self.cmd('-a 1 2')

        eq_(self.v.a, [1, 2])
Beispiel #2
0
 def test_9(self):
     self.add('a', default=False, action='store_true', type=bool)
     self.cmd('')
     eq_(self.v.a, False)
Beispiel #3
0
 def test_1(self):
     self.add('a', nargs='+', type=int)
     self.cmd('-a 1 2')
     
     eq_(self.v.a, [1, 2])
Beispiel #4
0
 def test_7(self):
     self.add('a', action='store_true', type=bool)
     self.cmd('-a')
     eq_(self.v.a, True)
Beispiel #5
0
 def test_8(self):
     self.add('a', action='store_true')
     self.cmd('-a')
     eq_(self.v.a, True)
Beispiel #6
0
 def test_4(self):
     sys.stderr = open('/dev/null', 'w')
     self.add('a', choices=[1, 2], type=float)
     self.cmd('-a 5')
     eq_(self.v.a, 5.0)
     sys.stderr = sys.__stderr__
Beispiel #7
0
def test_iterator():
    from msmbuilder.arglib import _iter_both_cases
    got = [e for e in _iter_both_cases("string")]
    expected = ['s', 'S', 't', 'T', 'r', 'R', 'i', 'I', 'n', 'N', 'g', 'G']

    eq_(got, expected)
Beispiel #8
0
 def test_6(self):
     self.add('a', choices=[1, 2], type=int)
     self.cmd('-a 1')
     eq_(self.v.a, 1)
Beispiel #9
0
 def test_7(self):
     self.add('a', action='store_true', type=bool)
     self.cmd('-a')
     eq_(self.v.a, True)
Beispiel #10
0
 def test_4(self):
     sys.stderr = open('/dev/null', 'w')
     self.add('a', choices=[1,2], type=float)
     self.cmd('-a 5')
     eq_(self.v.a, 5.0)
     sys.stderr = sys.__stderr__
Beispiel #11
0
 def test_5(self):
     self.add('a', choices=['1', '2'], type=int)
     self.cmd('-a 1')
     eq_(self.v.a, 1.0)
Beispiel #12
0
def test_iterator():
    from msmbuilder.arglib import _iter_both_cases
    got = [e for e in _iter_both_cases("string")]
    expected = ['s', 'S', 't', 'T', 'r', 'R', 'i', 'I', 'n', 'N', 'g', 'G']

    eq_(got, expected)
Beispiel #13
0
 def test_3(self):
     self.add('a', type=float)
     self.cmd('-a 5')
     eq_(self.v.a, 5.0)
Beispiel #14
0
 def test_2(self):
     self.add('a', type=int)
     self.cmd('-a 4')
     eq_(self.v.a, 4)
Beispiel #15
0
 def test_2(self):
     self.add('a', type=int)
     self.cmd('-a 4')
     eq_(self.v.a, 4)
Beispiel #16
0
 def test_71(self):
     self.add('a', action='store_false', type=bool)
     self.cmd('-a')
     eq_(self.v.a, False)
Beispiel #17
0
 def test_3(self):
     self.add('a', type=float)
     self.cmd('-a 5')
     eq_(self.v.a, 5.0)
Beispiel #18
0
 def test_8(self):
     self.add('a', action='store_true')
     self.cmd('-a')
     eq_(self.v.a, True)
Beispiel #19
0
 def test_5(self):
     self.add('a', choices=['1', '2'], type=int)
     self.cmd('-a 1')
     eq_(self.v.a, 1.0)
Beispiel #20
0
 def test_81(self):
     self.add('b', action='store_false')
     self.cmd('-b')
     eq_(self.v.b, False)
Beispiel #21
0
 def test_6(self):
     self.add('a', choices=[1, 2], type=int)
     self.cmd('-a 1')
     eq_(self.v.a, 1)
Beispiel #22
0
 def test_9(self):
     self.add('a', default=False, action='store_true', type=bool)
     self.cmd('')
     eq_(self.v.a, False)    
Beispiel #23
0
 def test_71(self):
     self.add('a', action='store_false', type=bool)
     self.cmd('-a')
     eq_(self.v.a, False)
Beispiel #24
0
 def test_10(self):
     self.add('a', action='store_true', type=bool)
     self.cmd('')
     eq_(self.v.a, False)
Beispiel #25
0
 def test_81(self):
     self.add('b', action='store_false')
     self.cmd('-b')
     eq_(self.v.b, False)
Beispiel #26
0
 def test_0(self):
     self.add('a', nargs='+')
     self.cmd('-a 1 2')
     eq_(self.v.a, ['1', '2'])
Beispiel #27
0
 def test_10(self):
     self.add('a', action='store_true', type=bool)
     self.cmd('')
     eq_(self.v.a, False)
Beispiel #28
0
 def test_0(self):
     self.add('a', nargs='+')
     self.cmd('-a 1 2')
     eq_(self.v.a, ['1', '2'])