Beispiel #1
0
def test_valid_name():
    assert utils.valid_name('math:factorial')

    assert utils.valid_name('math:factorial', include_pattern='math')
    assert utils.valid_name('math:factorial', include_pattern='.*:factorial$')
    assert not utils.valid_name('math:factorial', include_pattern='abc')

    assert not utils.valid_name('math:factorial', exclude_pattern='math')
    assert not utils.valid_name('math:factorial', exclude_pattern='.*:factorial$')
    assert utils.valid_name('math:factorial', exclude_pattern='abc')

    assert utils.valid_name('math:factorial', include_pattern='m', exclude_pattern='moo')
    assert not utils.valid_name('math:factorial', include_pattern='m', exclude_pattern='math')
Beispiel #2
0
def test_valid_name():
    assert not utils.valid_name('math:factorial', [re.compile('a')], [])
    assert utils.valid_name('math:factorial', [re.compile('m')], [])
    assert utils.valid_name('math:factorial', [re.compile('.*factorial$')], [re.compile('moo')])
    assert not utils.valid_name('math:factorial', [re.compile('m')], [re.compile('math')])
Beispiel #3
0
def test_valid_name():
    assert not utils.valid_name('math:factorial', [re.compile('a')], [])
    assert utils.valid_name('math:factorial', [re.compile('m')], [])
    assert utils.valid_name('math:factorial', [re.compile('.*factorial$')], [re.compile('moo')])
    assert not utils.valid_name('math:factorial', [re.compile('m')], [re.compile('math')])