コード例 #1
0
ファイル: test_helpers.py プロジェクト: rivermont/khard
 def test_empty_list_returns_empty_string(self):
     the_list = []
     delimiter = ' '
     expected = ''
     actual = helpers.list_to_string(the_list, delimiter)
     self.assertEqual(actual, expected)
コード例 #2
0
ファイル: test_helpers.py プロジェクト: rivermont/khard
 def test_multi_level_nested_list(self):
     the_list = ['a', ['b', ['c', [[['x', 'y']]]]], 'z']
     delimiter = ' '
     expected = 'a b c x y z'
     actual = helpers.list_to_string(the_list, delimiter)
     self.assertEqual(actual, expected)
コード例 #3
0
ファイル: test_helpers.py プロジェクト: rivermont/khard
 def test_list_to_string_passes_through_other_objects(self):
     self.assertIs(helpers.list_to_string(None, "foo"), None)
     self.assertIs(helpers.list_to_string(42, "foo"), 42)
     self.assertIs(helpers.list_to_string("foo bar", "foo"), "foo bar")
コード例 #4
0
ファイル: test_helpers.py プロジェクト: rivermont/khard
 def test_simple_nested_list(self):
     the_list = ['a', 'bc', ['x', 'y', 'z'], 'def']
     delimiter = ' '
     expected = 'a bc x y z def'
     actual = helpers.list_to_string(the_list, delimiter)
     self.assertEqual(actual, expected)
コード例 #5
0
ファイル: test_helpers.py プロジェクト: lucc/khard
 def test_list_to_string_passes_through_other_objects(self):
     self.assertIs(helpers.list_to_string(None, "foo"), None)
     self.assertIs(helpers.list_to_string(42, "foo"), 42)
     self.assertIs(helpers.list_to_string("foo bar", "foo"), "foo bar")
コード例 #6
0
ファイル: test_helpers.py プロジェクト: lucc/khard
 def test_multi_level_nested_list(self):
     the_list = ['a', ['b', ['c', [[['x', 'y']]]]], 'z']
     delimiter = ' '
     expected = 'a b c x y z'
     actual = helpers.list_to_string(the_list, delimiter)
     self.assertEqual(actual, expected)
コード例 #7
0
ファイル: test_helpers.py プロジェクト: lucc/khard
 def test_simple_nested_list(self):
     the_list = ['a', 'bc', ['x', 'y', 'z'], 'def']
     delimiter = ' '
     expected = 'a bc x y z def'
     actual = helpers.list_to_string(the_list, delimiter)
     self.assertEqual(actual, expected)
コード例 #8
0
ファイル: test_helpers.py プロジェクト: lucc/khard
 def test_empty_list_returns_empty_string(self):
     the_list = []
     delimiter = ' '
     expected = ''
     actual = helpers.list_to_string(the_list, delimiter)
     self.assertEqual(actual, expected)