コード例 #1
0
ファイル: test_text.py プロジェクト: aaruff/Z-Modulo
from unittest import TestCase
from zmodulo.plot.text.text import Text

__author__ = 'aruff'


class TestText(TestCase):
    """ Tester for the plot text Text
    """

    def test_default_declaration_generation(self):
        """
        Tests the generation of a font type declaration with
        no parameters
        """
        test = Text()
        self.assertEqual(test.to_str(), '\ttext = "";\n')

    def test_string_named_value_declaration_generation(self):
        """
        Tests the generation of a font type declaration with
        string parameters
        """
        test = Text("Pooky")
        self.assertEqual(test.to_str(), '\ttext = "Pooky";\n')

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

コード例 #2
0
ファイル: test.py プロジェクト: threathive/pyeti
        self.assertFalse('This is broken' in str(context.exception))

    def test_has_test_connection(self):
        api = pyeti.YetiApi(self.url)
        try:
            api._test_connection()
        except:
            pass

    def test_has__make_post(self):
        api = pyeti.YetiApi(self.url)
        with self.assertRaises(TypeError) as context:
            api._make_post()
        self.assertFalse('This is broken' in str(context.exception))

    def test_has_make_get(self):
        api = pyeti.YetiApi(self.url)
        with self.assertRaises(TypeError) as context:
            api._make_get()
        self.assertFalse('This is broken' in str(context.exception))

    def test_has_make_request(self):
        api = pyeti.YetiApi(self.url)
        with self.assertRaises(TypeError) as context:
            api._make_request()
        self.assertFalse('This is broken' in str(context.exception))


if __name__ == '__main__':
    TestCase.main()
コード例 #3
0
ファイル: tests.py プロジェクト: CharlesGust/django-imagr
        self.assertEqual(response.status_code, 302)

        response = self.client.get('/imagr_app/follow/')
        self.assertEqual(response.status_code, 302)

        response = self.client.get('/imagr_app/history/')
        self.assertEqual(response.status_code, 302)

        response = self.client.get('/imagr_app/photo/1')
        self.assertEqual(response.status_code, 301)

        response = self.client.get('/imagr_app/photo/8/')
        self.assertEqual(response.status_code, 302)

        response = self.client.get('/imagr_app/delete_photo/1')
        self.assertEqual(response.status_code, 301)

        response = self.client.get('/imagr_app/delete_album/1')
        self.assertEqual(response.status_code, 301)


# These test cases should be simple enough to require no Django
class testImagrunittestTestCase(unittestTestCase):
    pass


if __name__ == '__main__':
    setup_test_environment()
    unittestTestCase.main()
    teardown_test_environment()