Ejemplo n.º 1
0
 def test_input_equality(self):
     a = Input()
     a.value = "hi"
     a.is_secret = True
     b = Input()
     b.value = "hi"
     b.is_secret = True
     assert a == b
Ejemplo n.º 2
0
 def test_input_equality(self):
     a = Input()
     a.value = 'hi'
     a.is_secret = True
     b = Input()
     b.value = 'hi'
     b.is_secret = True
     assert a == b
Ejemplo n.º 3
0
 def test_parse_param_line_with_dict(self):
     """ parse_param_line should accept a dict to configure itself """
     test_line = "test?==result#{'prompt':'would you like to do something?'}"
     value, config = self.inputs._parse_param_line(test_line)
     assert value == 'test'
     test_config = Input()
     test_config.prompt = 'would you like to do something?'
     test_config.is_secret = True
     test_config.default = 'result'
     assert config == test_config
Ejemplo n.º 4
0
 def test_parse_param_line_with_dict(self):
     """ parse_param_line should accept a dict to configure itself """
     test_line = "test?==result#{'prompt':'would you like to do something?'}"
     value, config = self.inputs._parse_param_line(test_line)
     assert value == "test"
     test_config = Input()
     test_config.prompt = "would you like to do something?"
     test_config.is_secret = True
     test_config.default = "result"
     assert config == test_config
Ejemplo n.º 5
0
 def test_write_values(self):
     """ Only write values should be returned by write_values """
     secret = Input()
     secret.value = "value"
     secret.is_secret = True
     not_secret = Input()
     not_secret.value = "not_secret_value"
     self.inputs.add_input("secret_key", secret)
     self.inputs.add_input("not_secret_key", not_secret)
     tools.eq_(self.inputs.write_values(), {"not_secret_key": "not_secret_value"})
Ejemplo n.º 6
0
 def test_write_values(self):
     """ Only write values should be returned by write_values """
     secret = Input()
     secret.value = 'value'
     secret.is_secret = True
     not_secret = Input()
     not_secret.value = 'not_secret_value'
     self.inputs.add_input('secret_key', secret)
     self.inputs.add_input('not_secret_key', not_secret)
     tools.eq_(self.inputs.write_values(),
               {'not_secret_key': 'not_secret_value'})
Ejemplo n.º 7
0
 def test_write_values(self):
     """ Only write values should be returned by write_values """
     secret = Input()
     secret.value = 'value'
     secret.is_secret = True
     not_secret = Input()
     not_secret.value = 'not_secret_value'
     self.inputs.add_input('secret_key', secret)
     self.inputs.add_input('not_secret_key', not_secret)
     tools.eq_(self.inputs.write_values(), {
         'not_secret_key': 'not_secret_value'
     })