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)
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)
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)
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)
def test_includes_parse_simple(): include = ReleaseIncludes.parse(['artists']) assert_true(include.artists)
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)