예제 #1
0
def test_check_permutation():
    string1 = "test"
    string2 = "sett"
    assert check_permutation.check_permutation(string1, string2) is True
    string1 = "test"
    string2 = "sets"
    assert check_permutation.check_permutation(string1, string2) is False
    def test_check_permutation(self):
        result1 = check_permutation("penguin", "gepninu")
        result2 = check_permutation("trash", "can")

        self.assertEqual(result1, True)
        self.assertEqual(result2, False)
 def test_both_empty_string(self):
     self.assertTrue(check_permutation("", ""))
 def test_empty_string(self):
     self.assertFalse(check_permutation("", "Empty test"))
 def test_permutation(self):
     self.assertTrue(check_permutation("Permutation", "rmtaontiPeu"))
 def test_same_length_non_permutation(self):
     self.assertFalse(check_permutation("Hello", "World"))
 def test_different_length_strings(self):
     self.assertFalse(check_permutation("Hey", "Hello you"))
예제 #8
0
 def test_baseline(self):
     self.assertTrue(check_permutation.check_permutation("god", "dog"))
예제 #9
0
 def test_complexWhitespaceTrue(self):
     self.assertTrue(
         check_permutation.check_permutation("hello world", "lll ooehrwd"))
예제 #10
0
 def test_withWhitespace(self):
     self.assertFalse(
         check_permutation.check_permutation("hello world",
                                             "goodbye world"))
예제 #11
0
 def test_lengthDiff(self):
     self.assertFalse(
         check_permutation.check_permutation("hello", "goodbye"))
def test_check_permutation():
    assert check_permutation("hello", "hello") is True
    assert check_permutation("hello", "olleh") is True
    assert check_permutation("hello", "holel") is True
    assert check_permutation("hello", "lehol") is True
    assert check_permutation("helo", "hello") is False
예제 #13
0
def test_check_permutation():
    assert check_permutation('abc', 'cba') is True
    assert check_permutation('abc', 'dba') is False
    assert check_permutation('abcd', 'dba') is False
    assert check_permutation('ab', 'dba') is False
    assert check_permutation('', '') is True