def test_07_sample_data(self): dat = [ 'website:twitter,sender:@random,text:"Really love the new Star Wars film"', 'website:wikipedia,page:https://en.wikipedia.org/wiki/Exilioidea, text:"Exilioidea is a genus of sea snails, marine gastropod mollusks in the family Ptychatractidae"', 'source:person,actor:self,text:"I like cheese"', ] more_metadata = [ { 'label': 'test_label', 'value': 'test_value' }, ] bias = mod_bias.Bias(more_metadata) self.assertEqual( str(bias), """Bias test_label = test_value BIAS Rating = 1 """) for d in dat: print(d) pass
def test_03_get_source_person(self): bias = mod_bias.Bias('AAA', 'BBB', 'CCC', 'DDD') self.assertEqual(bias.get_source_person(), 'DDD')
def test_02_calc_bias(self): bias = mod_bias.Bias('gov.au', 'published_data', 'abs.gov.au', '') self.assertEqual(bias.get_bias_rating(), 0.863)
def test_01_str(self): self.bias = mod_bias.Bias('gov.au', 'published_data', 'abs.gov.au', '') self.assertEqual(len(str(self.bias)), 130)
def test_06_get_bias_details(self): bias5 = mod_bias.Bias(test_metadata) self.assertEqual(bias5.get_bias_details()[0:17], 'Bias File Details') self.assertTrue(len(bias5.get_bias_details()) > 200)
def test_02_calc_bias(self): bias = mod_bias.Bias(test_metadata) self.assertEqual(bias.get_bias_rating(), 14.848288519170794) # 5.9457650345124735e-09)
def test_01_str(self): self.bias = mod_bias.Bias(test_metadata) self.assertEqual(len(str(self.bias)), 149)