Пример #1
0
    def test_dict(self):
        with capture() as c:
            puts({
                'key': 'value',
                'nonetype': None,
                'nested': {'deep': 'value'},
            })

        self.assertEqual(len(c.getvalue().splitlines()), 3)
Пример #2
0
    def test_dict(self):
        with capture() as c:
            puts({
                'key': 'value',
                'nonetype': None,
                'nested': {'deep': 'value'},
            })

        self.assertEqual(len(c.getvalue().splitlines()), 3)
Пример #3
0
def main():
    try:
        sys.path.append(os.getcwd())
        imp.load_source('manage_file', os.path.join(os.getcwd(), 'manage.py'))
    except IOError as exc:
        return puts(cli.red(exc))

    from manage_file import manager

    manager.main()
Пример #4
0
def main():
    try:
        sys.path.append(os.getcwd())
        imp.load_source('manager', os.path.join(os.getcwd(), 'manage.py'))
    except IOError:
        return puts(cli.red('No such file manage.py'))

    from manager import manager

    manager.main()
Пример #5
0
    def test_false(self):
        with capture() as c:
            puts(False)

        self.assertEqual(c.getvalue(), 'FAILED\n')
Пример #6
0
    def test_true(self):
        with capture() as c:
            puts(True)

        self.assertEqual(c.getvalue(), 'OK\n')
Пример #7
0
    def test_list_strip_carriage_returns(self):
        with capture() as c:
            puts(['first line\n', 'second line\n'])

        self.assertEqual(len(c.getvalue().splitlines()), 2)
Пример #8
0
    def test_empty(self):
        with capture() as c:
            puts('')

        self.assertEqual(c.getvalue(), '\n')
Пример #9
0
    def test_none(self):
        with capture() as c:
            puts(None)

        self.assertEqual(c.getvalue(), '')
Пример #10
0
    def test_false(self):
        with capture() as c:
            puts(False)

        self.assertEqual(c.getvalue(), 'FAILED\n')
Пример #11
0
    def test_true(self):
        with capture() as c:
            puts(True)

        self.assertEqual(c.getvalue(), 'OK\n')
Пример #12
0
    def test_list_strip_carriage_returns(self):
        with capture() as c:
            puts(['first line\n', 'second line\n'])

        self.assertEqual(len(c.getvalue().splitlines()), 2)
Пример #13
0
    def test_empty(self):
        with capture() as c:
            puts('')

        self.assertEqual(c.getvalue(), '\n')
Пример #14
0
    def test_none(self):
        with capture() as c:
            puts(None)

        self.assertEqual(c.getvalue(), '')