Sha256: c8a6dc595ba72995ed9fced784672eaae9aa27b53c0dc3b4fdb3cea20daf12b2

Contents?: true

Size: 856 Bytes

Versions: 147

Compression:

Stored size: 856 Bytes

Contents

import unittest

from crypto_square import encode


class CryptoSquareTest(unittest.TestCase):
    def test_empty_string(self):
        self.assertEqual(encode(''), '')

    def test_perfect_square(self):
        self.assertEqual(encode('ABCD'), 'ac bd')

    def test_small_imperfect_square(self):
        self.assertEqual(encode('This is easy!'), 'tis hsy ie sa')

    def test_punctuation_and_numbers(self):
        msg = "1, 2, 3, Go! Go, for God's sake!"
        ciph = '1gga 2ook 3fde gos ors'
        self.assertEqual(encode(msg), ciph)

    def test_long_string(self):
        msg = ("If man was meant to stay on the ground, god would have given "
               "us roots.")
        ciph = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau"
        self.assertEqual(encode(msg), ciph)


if __name__ == '__main__':
    unittest.main()

Version data entries

147 entries across 147 versions & 1 rubygems

Version Path
trackler-2.2.1.56 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.55 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.54 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.53 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.52 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.51 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.50 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.49 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.48 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.47 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.46 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.45 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.44 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.43 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.42 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.41 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.40 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.39 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.38 tracks/python/exercises/crypto-square/crypto_square_test.py
trackler-2.2.1.37 tracks/python/exercises/crypto-square/crypto_square_test.py