-
Notifications
You must be signed in to change notification settings - Fork 9
/
00.py
30 lines (21 loc) · 889 Bytes
/
00.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /usr/bin/env python
from __future__ import print_function
# Author: Victor Terron (c) 2015
# Email: `echo vt2rron1iaa32s | tr 132 @.e`
# License: GNU GPLv3
""" How do you determine whether a string is a permutation of another? """
import unittest
def is_permutation(word, another):
pass # place magic here
class AllUniqueTests(unittest.TestCase):
def test_all_unique(self):
self.assertTrue (is_permutation("", ""))
self.assertTrue (is_permutation("a", "a"))
self.assertTrue (is_permutation("aab", "aba"))
self.assertTrue (is_permutation("dog", "God"))
self.assertTrue (is_permutation("Buckethead", "Death Cube K"))
self.assertTrue (is_permutation("Quid est veritas", "Est vir qui adest"))
self.assertFalse(is_permutation("draft", "soft"))
self.assertFalse(is_permutation("master", "muster"))
if __name__ == "__main__":
unittest.main()