def test_properties(es_cdlc): cdlc = CustomDLC.get(49874) assert_that( cdlc.full_title).is_equal_to("Trey Parker - Jackin' It In San Diego") assert_that( cdlc.link).is_equal_to('https://customsforge.com/process.php?id=49874') cdlc.update(direct_download='direct_link') same_cdlc = list(CustomDLC.search().query('match', id='49874')) assert_that(same_cdlc).is_length(1) assert_that(same_cdlc[0].link).is_equal_to('direct_link')
def test_partial_update_for_non_existent_document(es_cdlc): try: CustomDLC(_id=100000).update(id=100000) assert False # exception should be thrown! except NotFoundError: assert_that(CustomDLC.get(100000, ignore=[404])).is_none()
def test_playable(es_cdlc): assert_that(CustomDLC.get( 49706).is_playable).is_true() # official is still playable assert_that(CustomDLC.get(49792).is_playable).is_false() # no pc assert_that( CustomDLC.get(49841).is_playable).is_false() # no lead or rhythm
def to_direct_link(self, cdlc_id: Union[str, int]) -> str: c = CustomDLC.get(cdlc_id, ignore=[404]) return c.direct_download if c else None