def test_b(self):
     """Test a single configuration is retrieved."""
     config = self.db.ConfigurationToValidate()
     config.save()
     retriever = ConfigurationsRetriever()
     retriever.db = self.db
     self.assertEqual([config], retriever.retrieve_configurations())
Beispiel #2
0
def local_create_configurations_retriever():
    file_name_retriever = None
    configuration_factory = None
    retriever = \
        ConfigurationsRetriever(file_name_retriever, configuration_factory)
    configuration_list = [
        {'polder': 'Atekpolder',
         'type':   'waterbalans',
         'user':   '******',
         'date':   '1-02-2012 11:00',
         'action': 'Bewaren'},
        {'polder': 'Atekpolder',
         'type':   'ESF_1',
         'user':   '******',
         'date':   '1-02-2012 11:00',
         'action': 'Bewaren'},
        {'polder': 'Aetsveldsepolder Oost',
         'type':   'ESF_2',
         'user':   '******',
         'date':   '1-02-2012 11:00',
         'action': 'Bewaren'},
        {'polder': 'Aetsveldsepolder Oost',
         'type':   'waterbalans',
         'user':   '******',
         'date':   '1-02-2012 11:00',
         'action': 'Bewaren'}
        ]
    retriever.retrieve_configurations = \
        (lambda: [MockConfig(config) for config in configuration_list])
    return retriever
    def test_a(self):
        """Test no configurations are retrieved.

        There are no configurations to validate.

        """
        retriever = ConfigurationsRetriever()
        retriever.db = self.db
        self.assertEqual([], retriever.retrieve_configurations())
Beispiel #4
0
def local_create_configurations_retriever():
    file_name_retriever = None
    configuration_factory = None
    retriever = ConfigurationsRetriever(file_name_retriever, configuration_factory)
    configuration_list = [
        {
            "polder": "Atekpolder",
            "type": "waterbalans",
            "user": "******",
            "date": "1-02-2012 11:00",
            "action": "Bewaren",
        },
        {
            "polder": "Atekpolder",
            "type": "ESF_1",
            "user": "******",
            "date": "1-02-2012 11:00",
            "action": "Bewaren",
        },
        {
            "polder": "Aetsveldsepolder Oost",
            "type": "ESF_2",
            "user": "******",
            "date": "1-02-2012 11:00",
            "action": "Bewaren",
        },
        {
            "polder": "Aetsveldsepolder Oost",
            "type": "waterbalans",
            "user": "******",
            "date": "1-02-2012 11:00",
            "action": "Bewaren",
        },
    ]
    retriever.retrieve_configurations = lambda: [MockConfig(config) for config in configuration_list]
    return retriever