Ejemplo n.º 1
0
    def test_add_two_parameters(self):
        dataset = Dataset(self.session,
                          "Foo Name",
                          title=self._TITLE,
                          create=True,
                          independents=self._INDEPENDENTS,
                          dependents=self._DEPENDENTS)

        dataset.param_listeners.add('listener')
        dataset.addParameters([('param 2', 'data 2'), ('param 3', 'data 3')])
        self.hub.onNewParameter.assert_called_with(None, set(['listener']))
        self.assertEqual(['param 2', 'param 3'], dataset.getParamNames())
        self.assertEqual('data 2', dataset.getParameter('param 2'))
        self.assertEqual('data 3', dataset.getParameter('param 3'))
Ejemplo n.º 2
0
    def test_add_two_parameters(self):
        dataset = Dataset(
                self.session,
                "Foo Name",
                title=self._TITLE,
                create=True,
                independents=self._INDEPENDENTS,
                dependents=self._DEPENDENTS)

        dataset.param_listeners.add('listener')
        dataset.addParameters([('param 2', 'data 2'), ('param 3', 'data 3')])
        self.hub.onNewParameter.assert_called_with(None, set(['listener']))
        self.assertEqual(['param 2', 'param 3'], dataset.getParamNames())
        self.assertEqual('data 2', dataset.getParameter('param 2'))
        self.assertEqual('data 3', dataset.getParameter('param 3'))