def test_all_possible_actions(self): self.assertEqual(handshake(15), ['wink', 'double blink', 'close your eyes', 'jump'])
def test_do_nothing_for_zero(self): self.assertEqual(handshake(0), [])
def test_combine_two_actions(self): self.assertEqual(handshake(3), ['wink', 'double blink'])
def test_reversing_one_action_gives_the_same_action(self): self.assertEqual(handshake(24), ['jump'])
def test_close_your_eyes_for_100(self): self.assertEqual(handshake(4), ['close your eyes'])
def test_composition3(self): self.assertEqual('111', code(handshake('111')))
def test_reversing_no_actions_still_gives_no_actions(self): self.assertEqual(handshake(16), [])
def test_reverse_two_actions(self): self.assertEqual(handshake(19), ['double blink', 'wink'])
def test_jump_for_1000(self): self.assertEqual(handshake(8), ['jump'])
def test_shake_negative_int(self): self.assertEqual([], handshake(-9))
def test_reverse_all_possible_actions(self): self.assertEqual(handshake(31), ['jump', 'close your eyes', 'double blink', 'wink'])
def test_composition1(self): self.assertEqual('11011', code(handshake(27)))
def test_shake_int(self): self.assertEqual(['wink', 'jump'], handshake(9))
def test_reversible1(self): self.assertEqual(secret_code(handshake(27)), 27)
def test_double_blink_for_10(self): self.assertEqual(handshake(2), ['double blink'])
def test_reversible2(self): self.assertEqual(secret_code(handshake(1)), 1)
def test_reversible3(self): self.assertEqual(secret_code(handshake(7)), 7)
def test_reversible4(self): inp = ['wink', 'double blink', 'jump'] self.assertEqual(handshake(secret_code(inp)), inp)
def test_wink_for_1(self): self.assertEqual(handshake(1), ['wink'])
def test_shake_bin2(self): self.assertEqual(['wink', 'close your eyes'], handshake('101'))
def test_shake_bin_invalid(self): self.assertEqual([], handshake('121'))
def test_composition2(self): self.assertEqual('1', code(handshake(1)))
def test_composition4(self): inp = ['wink', 'double blink', 'jump'] self.assertEqual(inp, handshake(code(inp)))
def test_shake_bin1(self): self.assertEqual(['close your eyes', 'double blink'], handshake('10110'))