コード例 #1
0
def test_includes_parse_dotted():
    include = ReleaseIncludes({'artists': True, 'mediums': MediumIncludes({})})
    assert_raises(AttributeError, getattr, include, 'does_not_exist')
    assert_true(include.artists)
    assert_true(include.mediums)
    assert_false(include.mediums.tracks)
    assert_false(include.mediums.tracks.artists)
コード例 #2
0
def test_includes_parse_dotted_deep_params():
    include = ReleaseIncludes.parse([
        'artists',
        'mediums.tracks.(artists,recording.relationships.(artist,work))'
    ])
    assert_true(include.artists)
    assert_true(include.mediums)
    assert_true(include.mediums.tracks)
    assert_true(include.mediums.tracks.artists)
    assert_true(include.mediums.tracks.recording)
    assert_true(include.mediums.tracks.recording.relationships)
    assert_true(include.mediums.tracks.recording.relationships.artist)
    assert_true(include.mediums.tracks.recording.relationships.work)
コード例 #3
0
def test_includes_parse_dotted_deep():
    include = ReleaseIncludes.parse(['artists', 'mediums.tracks.artists'])
    assert_true(include.artists)
    assert_true(include.mediums)
    assert_true(include.mediums.tracks)
    assert_true(include.mediums.tracks.artists)
コード例 #4
0
def test_includes_parse_simple_2():
    include = ReleaseIncludes.parse(['artists', 'mediums'])
    assert_true(include.artists)
    assert_true(include.mediums)
    assert_false(include.mediums.tracks)
    assert_false(include.mediums.tracks.artists)
コード例 #5
0
def test_includes_parse_simple():
    include = ReleaseIncludes.parse(['artists'])
    assert_true(include.artists)
コード例 #6
0
def test_includes_getters_simple():
    include = ReleaseIncludes({'artists': True})
    assert_raises(AttributeError, getattr, include, 'does_not_exist')
    assert_true(include.artists)
    assert_false(include.mediums)