コード例 #1
0
ファイル: zebra_manager_test.py プロジェクト: sitron/lst
    def testNoExternalProjects(self):
        """should return a url with projects[]=*"""
        zebraManager = ZebraManager(AppContainer)

        projects = None
        start_date = "2013-02-02"

        url = zebraManager._get_zebra_url_for_activities(start_date=start_date, projects=projects)
        self.assertIn("projects[]=*", url)
        self.assertNotIn("internal[]=", url)
コード例 #2
0
ファイル: zebra_manager_test.py プロジェクト: valdelley/lst
    def testNoExternalProjects(self):
        """should return a url with projects[]=*"""
        zebraManager = ZebraManager(AppContainer)

        projects = None
        start_date = '2013-02-02'

        url = zebraManager._get_zebra_url_for_activities(start_date=start_date,
                                                         projects=projects)
        self.assertIn('projects[]=*', url)
        self.assertNotIn('internal[]=', url)
コード例 #3
0
ファイル: zebra_manager_test.py プロジェクト: valdelley/lst
    def testNoInternalProjects(self):
        """should return a url without internal[]"""
        zebraManager = ZebraManager(AppContainer)

        projects = None
        internal_projects = None
        start_date = '2013-02-02'
        project_type_to_consider = 'external'

        url = zebraManager._get_zebra_url_for_activities(
            start_date=start_date,
            projects=projects,
            internal_projects=internal_projects,
            project_type_to_consider=project_type_to_consider)
        self.assertIn('projects[]=*', url)
        self.assertNotIn('internal[]=', url)
コード例 #4
0
ファイル: zebra_manager_test.py プロジェクト: valdelley/lst
    def testAllProjectsUsingDefault(self):
        """should return a url with both internal[]=* and projects[]=*"""
        zebraManager = ZebraManager(AppContainer)

        projects = None
        internal_projects = None
        start_date = '2013-02-02'
        project_type_to_consider = 'all'

        url = zebraManager._get_zebra_url_for_activities(
            start_date=start_date,
            projects=projects,
            internal_projects=internal_projects,
            project_type_to_consider=project_type_to_consider)
        self.assertIn('projects[]=*', url)
        self.assertIn('internal[]=*', url)
コード例 #5
0
ファイル: zebra_manager_test.py プロジェクト: sitron/lst
    def testNoInternalProjects(self):
        """should return a url without internal[]"""
        zebraManager = ZebraManager(AppContainer)

        projects = None
        internal_projects = None
        start_date = "2013-02-02"
        project_type_to_consider = "external"

        url = zebraManager._get_zebra_url_for_activities(
            start_date=start_date,
            projects=projects,
            internal_projects=internal_projects,
            project_type_to_consider=project_type_to_consider,
        )
        self.assertIn("projects[]=*", url)
        self.assertNotIn("internal[]=", url)
コード例 #6
0
ファイル: zebra_manager_test.py プロジェクト: sitron/lst
    def testAllProjectsUsingDefault(self):
        """should return a url with both internal[]=* and projects[]=*"""
        zebraManager = ZebraManager(AppContainer)

        projects = None
        internal_projects = None
        start_date = "2013-02-02"
        project_type_to_consider = "all"

        url = zebraManager._get_zebra_url_for_activities(
            start_date=start_date,
            projects=projects,
            internal_projects=internal_projects,
            project_type_to_consider=project_type_to_consider,
        )
        self.assertIn("projects[]=*", url)
        self.assertIn("internal[]=*", url)
コード例 #7
0
ファイル: zebra_manager_test.py プロジェクト: valdelley/lst
    def testAllProjects(self):
        """should return a url with both internal[]= and projects[]= for each project"""
        zebraManager = ZebraManager(AppContainer)

        projects = [2, 3]
        internal_projects = [12, 14]
        start_date = '2013-02-02'
        project_type_to_consider = 'all'

        url = zebraManager._get_zebra_url_for_activities(
            start_date=start_date,
            projects=projects,
            internal_projects=internal_projects,
            project_type_to_consider=project_type_to_consider)
        self.assertNotIn('projects[]=*', url)
        self.assertNotIn('internal[]=*', url)
        self.assertIn('internal[]=12', url)
        self.assertIn('internal[]=14', url)
        self.assertIn('projects[]=2', url)
        self.assertIn('projects[]=3', url)
コード例 #8
0
ファイル: zebra_manager_test.py プロジェクト: valdelley/lst
    def testNoStartDate(self):
        """should raise an error"""
        zebraManager = ZebraManager(AppContainer)

        projects = [2, 3]
        start_date = None

        self.assertRaises(DevelopmentError,
                          zebraManager._get_zebra_url_for_activities,
                          start_date=start_date,
                          projects=projects)
コード例 #9
0
ファイル: zebra_manager_test.py プロジェクト: sitron/lst
    def testAllProjects(self):
        """should return a url with both internal[]= and projects[]= for each project"""
        zebraManager = ZebraManager(AppContainer)

        projects = [2, 3]
        internal_projects = [12, 14]
        start_date = "2013-02-02"
        project_type_to_consider = "all"

        url = zebraManager._get_zebra_url_for_activities(
            start_date=start_date,
            projects=projects,
            internal_projects=internal_projects,
            project_type_to_consider=project_type_to_consider,
        )
        self.assertNotIn("projects[]=*", url)
        self.assertNotIn("internal[]=*", url)
        self.assertIn("internal[]=12", url)
        self.assertIn("internal[]=14", url)
        self.assertIn("projects[]=2", url)
        self.assertIn("projects[]=3", url)
コード例 #10
0
 def get_zebra_manager(self):
     return ZebraManager(AppContainer)