Exemple #1
0
    def test_test(self):
        uri = utils.build_database_uri(testing=True,
                                       engine='sqlite',
                                       name='real_db',
                                       test_name=':memory:')

        assert uri == 'sqlite:///:memory:'
Exemple #2
0
    def test_user(self):
        uri = utils.build_database_uri(engine='postgresql',
                                       username='******',
                                       port=5432,
                                       name='example')

        assert uri == 'postgresql:///bob@localhost:5432/example'
Exemple #3
0
    def test_host_ip(self):
        uri = utils.build_database_uri(engine='postgresql',
                                       username='******',
                                       port=5432,
                                       hostname='::1',
                                       name='example')

        assert uri == 'postgresql:///bob@[::1]:5432/example'
Exemple #4
0
    def test_host(self):
        uri = utils.build_database_uri(engine='postgresql',
                                       username='******',
                                       port=5432,
                                       host='example.com',
                                       name='example')

        assert uri == 'postgresql:///[email protected]:5432/example'
Exemple #5
0
    def test_user_pass(self):
        uri = utils.build_database_uri(engine='postgresql',
                                       user='******',
                                       port=5432,
                                       name='example',
                                       **{'pass': '******'})

        assert uri == 'postgresql:///bob:b@localhost:5432/example'
Exemple #6
0
    def test_user(self):
        uri = utils.build_database_uri(
            engine='postgresql',
            username='******',
            port=5432,
            name='example')

        assert uri == 'postgresql:///bob@localhost:5432/example'
Exemple #7
0
    def test_user_pass(self):
        uri = utils.build_database_uri(
            engine='postgresql',
            user='******',
            port=5432,
            name='example', **{'pass': '******'})

        assert uri == 'postgresql:///bob:b@localhost:5432/example'
Exemple #8
0
    def test_test(self):
        uri = utils.build_database_uri(
            testing=True,
            engine='sqlite',
            name='real_db',
            test_name=':memory:')

        assert uri == 'sqlite:///:memory:'
Exemple #9
0
    def test_host_ip(self):
        uri = utils.build_database_uri(
            engine='postgresql',
            username='******',
            port=5432,
            hostname='::1',
            name='example')

        assert uri == 'postgresql:///bob@[::1]:5432/example'
Exemple #10
0
    def test_host(self):
        uri = utils.build_database_uri(
            engine='postgresql',
            username='******',
            port=5432,
            host='example.com',
            name='example')

        assert uri == 'postgresql:///[email protected]:5432/example'
Exemple #11
0
    def test_user_pass_test(self):
        uri = utils.build_database_uri(testing=True,
                                       engine='postgresql',
                                       test_engine='mysql',
                                       username='******',
                                       test_username='******',
                                       password='******',
                                       test_password='******',
                                       port=5432,
                                       test_port=1024,
                                       name='example')

        assert uri == 'mysql:///a:a@localhost:1024/test_example'
Exemple #12
0
    def test_user_pass_test(self):
        uri = utils.build_database_uri(
            testing=True,
            engine='postgresql',
            test_engine='mysql',
            username='******',
            test_username='******',
            password='******',
            test_password='******',
            port=5432,
            test_port=1024,
            name='example')

        assert uri == 'mysql:///a:a@localhost:1024/test_example'
Exemple #13
0
    def test_name(self):
        uri = utils.build_database_uri(engine='sqlite', name=':memory:')

        assert uri == 'sqlite:///:memory:'
Exemple #14
0
    def test_name(self):
        uri = utils.build_database_uri(
            engine='sqlite',
            name=':memory:')

        assert uri == 'sqlite:///:memory:'