def test_check_prefixes(self):
        """Verify the expected prefixes are present"""
        prefixes = ['k','p','c','o','f','g','s']
        id_, parsed = check_parse(good_string)
        self.assertTrue(check_prefixes(parsed, prefixes))

        id_, parsed = check_parse(bad_prefix)
        self.assertFalse(check_prefixes(parsed, prefixes))
    
        self.fail("check duplicate ranks")
Esempio n. 2
0
    def test_check_prefixes(self):
        """Verify the expected prefixes are present"""
        prefixes = ['k', 'p', 'c', 'o', 'f', 'g', 's']
        id_, parsed = check_parse(good_string)
        self.assertTrue(check_prefixes(parsed, prefixes))

        id_, parsed = check_parse(bad_prefix)
        self.assertFalse(check_prefixes(parsed, prefixes))

        self.fail("check duplicate ranks")
    def test_check_gap(self):
        """check if a gap exists in a string"""
        id_, parsed = check_parse(good_string)
        self.assertTrue(check_gap(parsed))

        id_, parsed = check_parse(good_trailing)
        self.assertTrue(check_gap, parsed)

        id_, parsed = check_parse(gap)
        self.assertFalse(check_gap(parsed))
Esempio n. 4
0
    def test_check_gap(self):
        """check if a gap exists in a string"""
        id_, parsed = check_parse(good_string)
        self.assertTrue(check_gap(parsed))

        id_, parsed = check_parse(good_trailing)
        self.assertTrue(check_gap, parsed)

        id_, parsed = check_parse(gap)
        self.assertFalse(check_gap(parsed))
    def test_check_parse(self):
        """returns valid parsed or raises"""
        exp = ("1",["k__a","p__b","c__c","o__d","f__e","g__f","s__g"])
        obs = check_parse(good_string)
        self.assertEqual(obs, exp)

        self.assertRaises(ParseError, check_parse, bad_string)
Esempio n. 6
0
    def test_check_parse(self):
        """returns valid parsed or raises"""
        exp = ("1", ["k__a", "p__b", "c__c", "o__d", "f__e", "g__f", "s__g"])
        obs = check_parse(good_string)
        self.assertEqual(obs, exp)

        self.assertRaises(ParseError, check_parse, bad_string)
    def test_check_n_levels(self):
        """requires N levels, or unclassified"""
        id_, parsed = check_parse(good_string)
        self.assertTrue(check_n_levels(parsed, 7))

        self.assertFalse(check_n_levels(parsed, 8))

        id_, parsed = check_parse(good_unclassified)
        self.assertTrue(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified1)
        self.assertFalse(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified2)
        self.assertFalse(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified3)
        self.assertFalse(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified4)
        self.assertFalse(check_n_levels(parsed, 7))
Esempio n. 8
0
    def test_check_n_levels(self):
        """requires N levels, or unclassified"""
        id_, parsed = check_parse(good_string)
        self.assertTrue(check_n_levels(parsed, 7))

        self.assertFalse(check_n_levels(parsed, 8))

        id_, parsed = check_parse(good_unclassified)
        self.assertTrue(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified1)
        self.assertFalse(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified2)
        self.assertFalse(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified3)
        self.assertFalse(check_n_levels(parsed, 7))

        id_, parsed = check_parse(bad_unclassified4)
        self.assertFalse(check_n_levels(parsed, 7))