コード例 #1
0
    def test_if_pagerank_file_contains_results(self):
        tests.valid_json_file(u'pagerank')
        with open(tests.get_submission_location(u'pagerank'), 'r') as fh:
            l = json.load(fh)

        self.assertTrue(len(l) == 20)
        self.assertGreater(len(l[0]), 0)
コード例 #2
0
    def test_if_hits_file_contains_results_tuple(self):
        tests.valid_json_file(u'hits')
        with open(tests.get_submission_location(u'hits'), 'r') as fh:
            hubs, authorities = json.load(fh)

        self.assertTrue(type(hubs) == dict)
        self.assertTrue(type(authorities) == dict)
コード例 #3
0
    def test_if_communities_file_contains_results_tuple(self):
        self.assertTrue(tests.valid_json_file(u'communities'))
        with open(tests.get_submission_location(u'communities'), 'r') as fh:
            iterations, components = json.load(fh)

        self.assertTrue(type(iterations) == int)
        self.assertTrue(type(components) == list)
コード例 #4
0
 def test_if_clustering_file_exists(self):
   self.assertTrue(os.path.exists(tests.get_submission_location(u'clustering')))
コード例 #5
0
 def test_if_clustering_file_contains_results_tuple(self):
   self.assertTrue(tests.valid_json_file(u'clustering'))
   with open(tests.get_submission_location(u'clustering'), 'r') as fh:
     _, _ = json.load(fh)
コード例 #6
0
 def test_if_pagerank_file_exists(self):
     self.assertTrue(
         os.path.exists(tests.get_submission_location(u'pagerank')))
コード例 #7
0
 def test_if_distance_file_exists(self):
     self.assertTrue(
         os.path.exists(tests.get_submission_location(u'distance')))
コード例 #8
0
 def test_if_hits_file_exists(self):
     self.assertTrue(os.path.exists(tests.get_submission_location(u'hits')))
コード例 #9
0
 def test_if_communities_file_exists(self):
     self.assertTrue(
         os.path.exists(tests.get_submission_location(u'communities')))
コード例 #10
0
 def test_if_degree_file_contains_results_tuple(self):
     tests.valid_json_file(u'degree')
     with open(tests.get_submission_location(u'degree'), 'r') as fh:
         _, _, _ = json.load(fh)
コード例 #11
0
 def test_if_scatter_file_exists(self):
   self.assertTrue(os.path.exists(tests.get_submission_location(u'scatter')))