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.8.24 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.23 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.22 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.21 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.20 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.19 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.18 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.17 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.16 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.15 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.14 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.13 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.12 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.11 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.10 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.9 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.8 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.7 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.6 tracks/python/exercises/bracket-push/bracket_push_test.py
trackler-2.0.8.5 tracks/python/exercises/bracket-push/bracket_push_test.py