コード例 #1
0
ファイル: test_main.py プロジェクト: timka/mixer
def test_fakers():
    """ Test default fakers. """
    from mixer import fakers as f

    test = next(f.gen_name())
    assert test

    test = next(f.gen_city())
    assert test

    test = next(f.gen_lorem(length=30))
    assert len(test) == 30

    test = next(f.gen_numerify('##-####'))
    assert test

    test = next(f.gen_username(length=50))
    assert test

    test = next(f.gen_simple_username(length=50))
    assert test

    test = next(f.gen_hostname())
    assert test

    test = next(f.gen_email())
    assert test

    test = next(f.gen_email(host='gmail'))
    assert 'gmail' in test

    test = next(f.gen_ip4())
    assert '.' in test

    test = next(f.gen_url())
    assert '/' in test

    test = next(f.gen_uuid())
    assert '-' in test

    test = next(f.gen_phone())
    assert '-' in test

    test = next(f.gen_company())
    assert test

    test = next(f.gen_latlon())
    assert test

    test = next(f.gen_coordinates())
    assert test
コード例 #2
0
ファイル: test_main.py プロジェクト: imbaczek/mixer
    def test_faker(self):
        """ Test default fakers. """
        from mixer import fakers as f

        test = next(f.gen_name())
        self.assertTrue(test)

        test = next(f.gen_city())
        self.assertTrue(test)

        test = next(f.gen_lorem(length=30))
        self.assertEqual(len(test), 30)

        test = next(f.gen_numerify('##-####'))
        self.assertTrue(test)

        test = next(f.gen_username(length=50))
        self.assertTrue(test)

        test = next(f.gen_simple_username(length=50))
        self.assertTrue(test)

        test = next(f.gen_hostname())
        self.assertTrue(test)

        test = next(f.gen_email())
        self.assertTrue(test)

        test = next(f.gen_email(host='gmail'))
        self.assertTrue('gmail' in test)

        test = next(f.gen_ip4())
        self.assertTrue('.' in test)

        test = next(f.gen_url())
        self.assertTrue('/' in test)

        test = next(f.gen_uuid())
        self.assertTrue('-' in test)

        test = next(f.gen_phone())
        self.assertTrue('-' in test)

        test = next(f.gen_company())
        self.assertTrue(test)

        test = next(f.gen_latlon())
        self.assertTrue(test)

        test = next(f.gen_coordinates())
        self.assertTrue(test)
コード例 #3
0
ファイル: test_main.py プロジェクト: skyl/mixer
    def test_faker(self):
        """ Tests default fakers. """
        from mixer import fakers as f

        test = next(f.gen_name())
        self.assertTrue(test)

        test = next(f.gen_city())
        self.assertTrue(test)

        test = next(f.gen_lorem(length=30))
        self.assertEqual(len(test), 30)

        test = next(f.gen_numerify('##-####'))
        self.assertTrue(test)

        test = next(f.gen_username(length=50))
        self.assertTrue(test)

        test = next(f.gen_hostname())
        self.assertTrue(test)

        test = next(f.gen_email())
        self.assertTrue(test)

        test = next(f.gen_email(host='gmail'))
        self.assertTrue('gmail' in test)

        test = next(f.gen_ip4())
        self.assertTrue('.' in test)

        test = next(f.gen_url())
        self.assertTrue('/' in test)

        test = next(f.gen_uuid())
        self.assertTrue('-' in test)

        test = next(f.gen_phone())
        self.assertTrue('-' in test)

        test = next(f.gen_company())
        self.assertTrue(test)

        test = next(f.gen_latlon())
        self.assertTrue(test)

        test = next(f.gen_coordinates())
        self.assertTrue(test)
コード例 #4
0
def test_fakers():
    """ Test default fakers. """
    from mixer import fakers as f

    test = next(f.gen_name())
    assert test

    test = next(f.gen_city())
    assert test

    test = next(f.gen_lorem(length=30))
    assert len(test) <= 30

    test = next(f.gen_numerify('##-####'))
    assert test

    test = next(f.gen_username(length=50))
    assert test

    test = next(f.gen_simple_username(length=50))
    assert test

    test = next(f.gen_hostname())
    assert test

    test = next(f.gen_email())
    assert test

    test = next(f.gen_email(host='gmail'))
    assert 'gmail' in test

    test = next(f.gen_ip4())
    assert '.' in test

    test = next(f.gen_url())
    assert '/' in test

    test = next(f.gen_uuid())
    assert '-' in test

    test = next(f.gen_phone())
    assert '-' in test

    test = next(f.gen_company())
    assert test

    test = next(f.gen_latlon())
    assert test

    test = next(f.gen_coordinates())
    assert test

    test = next(f.gen_city())
    assert test

    test = next(f.gen_genre())
    assert test

    test = next(f.gen_short_lorem())
    assert test

    test = next(f.gen_slug())
    assert test

    test = next(f.gen_street())
    assert test

    test = next(f.gen_address())
    assert test