def test_list_duplicate_elimination_by_origin_id_no_duplicates(self): """ Function should return same list """ example = [ { "origin": { "id": "1", } }, { "origin": { "id": "2", } }, { "origin": { "id": "3", } }, ] resultado = RaMStats.duplicate_elimination_by_origin_id( RaMStats, example, False) self.assertEquals(["1", "2", "3"], resultado) self.assertEquals(3, len(resultado))
def test_list_duplicate_elimination_by_origin_id_empty_list(self): """ Function should return empty list """ example = [] resultado = RaMStats.duplicate_elimination_by_origin_id( RaMStats, example, False) self.assertEquals([], resultado) self.assertEquals(0, len(resultado))
def test_char_counter_no_encounter(self): """ Function should return 0 if there is no coincidence of chars """ example = [ { "name": "abcdefg" }, { "name": "bcdefgh" }, { "name": "cdefghi" }, ] count = RaMStats.char_count(RaMStats, example, 'x') self.assertEquals(0, count)
def test_char_counter_mixed(self): """ Function should return the correct amount of chars when its mixed """ example = [ { "name": "ABCDEFG" }, { "name": "bcdefgh" }, { "name": "CDEFGHI" }, ] count = RaMStats.char_count(RaMStats, example, 'd') self.assertEquals(3, count)
def test_char_counter_caps(self): """ Function should return the correct amount of chars when there is only CAP """ example = [ { "name": "ABCDEFG" }, { "name": "BCDEFGH" }, { "name": "CDEFGHI" }, ] count = RaMStats.char_count(RaMStats, example, 'd') self.assertEquals(3, count)
def test_char_counter_no_caps(self): """ Function should return the correct amount of chars when there is no cap """ example = [ { "name": "abcdefg" }, { "name": "bcdefgh" }, { "name": "cdefghi" }, ] count = RaMStats.char_count(RaMStats, example, 'd') self.assertEquals(3, count)