Ejemplo n.º 1
0
 def test_list(self):
     try:
         basic_type.string_type([1, 3, 5], ['node'])
         self.assertTrue(False)
     except TypeError as ex:
         self.assertEqual('node: Should be a string', ex.args[0])
Ejemplo n.º 2
0
 def test_dict(self):
     try:
         basic_type.string_type({'a': 1, 'b': 2}, ['node', '3'])
         self.assertTrue(False)
     except TypeError as ex:
         self.assertEqual('node.3: Should be a string', ex.args[0])
Ejemplo n.º 3
0
 def test_float(self):
     try:
         basic_type.string_type(3.4, ['3'])
         self.assertTrue(False)
     except TypeError as ex:
         self.assertEqual('3: Should be a string', ex.args[0])
Ejemplo n.º 4
0
 def test_integer(self):
     try:
         basic_type.string_type(4, ['node', '3'])
         self.assertTrue(False)
     except TypeError as ex:
         self.assertEqual('node.3: Should be a string', ex.args[0])
Ejemplo n.º 5
0
 def test_string(self):
     self.assertEqual('abc', basic_type.string_type('abc', []))
Ejemplo n.º 6
0
 def test_none(self):
     self.assertEqual(None, basic_type.string_type(None, []))