示例#1
0
 def test_extend_value_none_none(self):
     b = base.Base()
     ret = b._extend_value(None, None)
     self.assertEqual(len(ret), 0)
     self.assertFalse(ret)
示例#2
0
 def test_extend_value_none_list(self):
     b = base.Base()
     ret = b._extend_value(None, ['foo'])
     self.assertEqual(ret, ['foo'])
示例#3
0
 def test_extend_value_list_newstring(self):
     b = base.Base()
     value_list = ['first', 'second']
     new_value_string = 'this is the new values'
     ret = b._extend_value(value_list, new_value_string)
     self.assertEqual(value_list + [new_value_string], ret)
示例#4
0
 def test_extend_value_string_newstring(self):
     b = base.Base()
     some_string = 'some string'
     new_value_string = 'this is the new values'
     ret = b._extend_value(some_string, new_value_string)
     self.assertEqual([some_string, new_value_string], ret)
示例#5
0
 def test_extend_value_string_newlist(self):
     b = base.Base()
     some_string = 'some string'
     new_value_list = ['new_first', 'new_second']
     ret = b._extend_value(some_string, new_value_list)
     self.assertEqual([some_string] + new_value_list, ret)
示例#6
0
 def test_extend_value_newlist_list_prepend(self):
     b = base.Base()
     value_list = ['first', 'second']
     new_value_list = ['new_first', 'new_second']
     ret = b._extend_value(new_value_list, value_list, prepend=True)
     self.assertEqual(value_list + new_value_list, ret)
示例#7
0
 def test_extend_value_newlist_list(self):
     b = base.Base()
     value_list = ['first', 'second']
     new_value_list = ['new_first', 'new_second']
     ret = b._extend_value(new_value_list, value_list)
     self.assertEqual(new_value_list + value_list, ret)