コード例 #1
0
ファイル: test_helpers.py プロジェクト: okfn/ckanext-project
 def test_dataset_count_no_datasets(self):
     '''
     Dataset and project count is 0 when no datasets, and no projects.
     '''
     stats = project_helpers.get_site_statistics()
     nosetools.assert_equal(stats['dataset_count'], 0)
     nosetools.assert_equal(stats['project_count'], 0)
コード例 #2
0
ファイル: test_helpers.py プロジェクト: okfn/ckanext-project
    def test_dataset_count_no_datasets_some_projects(self):
        '''
        Dataset and project count is 0 when no datasets, but some projects.
        '''
        for i in xrange(0, 10):
            factories.Dataset(type='project')

        stats = project_helpers.get_site_statistics()
        nosetools.assert_equal(stats['dataset_count'], 0)
        nosetools.assert_equal(stats['project_count'], 10)
コード例 #3
0
ファイル: test_helpers.py プロジェクト: okfn/ckanext-project
    def test_dataset_count_some_datasets_no_projects(self):
        '''
        Dataset and project count is correct when there are datasets, but no
        projects.
        '''
        for i in xrange(0, 10):
            factories.Dataset()

        stats = project_helpers.get_site_statistics()
        nosetools.assert_equal(stats['dataset_count'], 10)
        nosetools.assert_equal(stats['project_count'], 0)