Sha256: 0040455fcea2956b71911d679cf9fcef18081ef44ff9f218e8722f59f26ecece

Contents?: true

Size: 960 Bytes

Versions: 125

Compression:

Stored size: 960 Bytes

Contents

import unittest

from bracket_push import check_brackets


class BracketPushTests(unittest.TestCase):

    def test_input_empty(self):
        self.assertEqual(check_brackets(""), True)

    def test_single(self):
        self.assertEqual(check_brackets("{}"), True)

    def test_unclosed(self):
        self.assertEqual(check_brackets("{{"), False)

    def test_wrong_order(self):
        self.assertEqual(check_brackets("}{"), False)

    def test_mixed_not_nested(self):
        self.assertEqual(check_brackets("{}[]"), True)

    def test_mixed_nested(self):
        self.assertEqual(check_brackets("{[]}"), True)

    def test_improperly_nested(self):
        self.assertEqual(check_brackets("{[}]"), False)

    def test_not_opened_nested(self):
        self.assertEqual(check_brackets("{[)][]}"), False)

    def test_nested_ensemble(self):
        self.assertEqual(check_brackets("{[]([()])}"), True)


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

Version data entries

125 entries across 125 versions & 1 rubygems

Version Path
trackler-2.0.2.0 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.1.2 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.1.1 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.1.0 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.10 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.9 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.8 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.7 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.6 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.5 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.4 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.3 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.2 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.1 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.0.0 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-1.0.4.1 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-1.0.4.0 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-1.0.3.0 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-1.0.2.1 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-1.0.2.0 tracks/python/exercises/bracket-push/bracket_push_test.py