예제 #1
0
 def test_four_items(self):
     items = ['foo', 'bar', 'baz', 'qux']
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, "'bar', 'baz', 'foo', and 'qux'")
예제 #2
0
 def test_one_item(self):
     items = ['foo']
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, "'foo'")
예제 #3
0
 def test_two_items(self):
     items = ['foo', 'bar']
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, "'bar' and 'foo'",
                      "Expected 'bar' before 'foo' due to sorting")
예제 #4
0
 def test_no_items(self):
     items = []
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, '')
예제 #5
0
 def test_four_items(self):
     items = ['foo', 'bar', 'baz', 'qux']
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, "'bar', 'baz', 'foo', and 'qux'")
예제 #6
0
 def test_two_items(self):
     items = ['foo', 'bar']
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, "'bar' and 'foo'",
                      "Expected 'bar' before 'foo' due to sorting")
예제 #7
0
 def test_one_item(self):
     items = ['foo']
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, "'foo'")
예제 #8
0
 def test_no_items(self):
     items = []
     output = lifecycle._humanize_list(items)
     self.assertEqual(output, '')