Пример #1
0
  def test_example_1(self):
    available = ["ham", "cheese", "mustard"]
    order = ["ham cheese"]
    value = which_order(available, order)

    self.assertEqual(value, 0)
Пример #2
0
  def test_example_3(self):
    available = [ "cheese", "cheese", "cheese", "tomato" ]
    order = [ "ham ham ham", "water", "pork", "bread", "cheese tomato cheese", "beef" ]
    value = which_order(available, order)

    self.assertEqual(value, 4)
Пример #3
0
  def test_example_4(self):
    available = [ "foo", "bar", "baz", "gazonk", "quux", "bat", "xyzzy", "shme", "hukarz", "grault", "waldo", "bleh" ]
    order = [ "kalatehas", "spam eggs", "needle haystack", "bleh blarg", "plugh", "the best sandwich in the universe" ]
    value = which_order(available, order)

    self.assertEqual(value, -1)
Пример #4
0
  def test_example_2(self):
    available = ["cheese", "mustard", "lettuce"]
    order = ["cheese ham", "cheese mustard lettuce", "ketchup", "beer"]
    value = which_order(available, order)

    self.assertEqual(value, 1)