Пример #1
0
def test_parse_job_id(func_name, app1, job_id1):
    nt.assert_dict_equal(
        {
            'date': 20140606,
            'collection_name': 'profile-%s' % func_name,
            'client_id': 1111
        }, api.parse_job_id(app1, job_id1))
    nt.assert_equal(job_id1,
                    api.create_job_id(app1, **api.parse_job_id(app1, job_id1)))
Пример #2
0
def test_parse_job_id(func_name, app1, job_id1):
    nt.assert_dict_equal(
        {'date': 20140606, 'collection_name': 'profile-%s' % func_name,
         'client_id': 1111},
        api.parse_job_id(app1, job_id1))
    nt.assert_equal(
        job_id1,
        api.create_job_id(app1, **api.parse_job_id(app1, job_id1))
    )
Пример #3
0
def test_create_job_id(app1, job_id1):
    with nt.assert_raises(KeyError):
        api.create_job_id(app1, a=1)
    with nt.assert_raises(InvalidJobId):
        api.create_job_id(
            app1, date=20141299, client_id=111, collection_name='profile')
    with nt.assert_raises(InvalidJobId):
        api.create_job_id(
            app1, date=20141212, client_id=111, collection_name='Profile')

    nt.assert_equal(
        '20141212_111_profile',
        api.create_job_id(
            app1, date=20141212, client_id=111, collection_name='profile'))
Пример #4
0
def test_create_job_id(app1, job_id1):
    with nt.assert_raises(KeyError):
        api.create_job_id(app1, a=1)
    with nt.assert_raises(InvalidJobId):
        api.create_job_id(app1,
                          date=20141299,
                          client_id=111,
                          collection_name='profile')
    with nt.assert_raises(InvalidJobId):
        api.create_job_id(app1,
                          date=20141212,
                          client_id=111,
                          collection_name='Profile')

    nt.assert_equal(
        '20141212_111_profile',
        api.create_job_id(app1,
                          date=20141212,
                          client_id=111,
                          collection_name='profile'))