Example #1
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
Example #2
0
    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)
Example #3
0
    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)
Example #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