def test_false_at_incorrect_options(self): inputfield = InputFieldF.build(type=InputField.TYPE_SELECT, options="not a dictionary at all!") header = {'fieldtype': 'Select', 'inputfield': inputfield} self.assertFalse(eie.write_domeinlijst(None, 0, header))
def test_a_string_isnt_a_dict(self): inputfield = InputFieldF.build( type=InputField.TYPE_SELECT, options=repr("not a dictionary at all!")) header = {'fieldtype': 'Select', 'inputfield': inputfield} self.assertFalse(eie.write_domeinlijst(None, 0, header))
def test_a_string_isnt_a_dict(self): inputfield = InputFieldF.build( type=InputField.TYPE_SELECT, options=repr("not a dictionary at all!")) header = { 'fieldtype': 'Select', 'inputfield': inputfield } self.assertFalse(eie.write_domeinlijst(None, 0, header))
def test_false_at_incorrect_options(self): inputfield = InputFieldF.build( type=InputField.TYPE_SELECT, options="not a dictionary at all!") header = { 'fieldtype': 'Select', 'inputfield': inputfield } self.assertFalse(eie.write_domeinlijst(None, 0, header))
def test_one_inputfield_one_code(self): worksheet = mock.MagicMock() inputfield = InputFieldF.build(type=InputField.TYPE_SELECT, options=repr({1: "first line"})) header = {"fieldtype": "Select", "inputfield": inputfield, "fieldname": "Test"} self.assertTrue(eie.write_domeinlijst(worksheet, 0, header)) expected = [mock.call(0, 0, "Code"), mock.call(0, 1, "Test"), mock.call(1, 0, 1), mock.call(1, 1, "first line")] self.assertEquals(worksheet.write.call_args_list, expected)
def test_one_inputfield_one_code(self): worksheet = mock.MagicMock() inputfield = InputFieldF.build(type=InputField.TYPE_SELECT, options=repr({1: "first line"})) header = { 'fieldtype': 'Select', 'inputfield': inputfield, 'fieldname': 'Test' } self.assertTrue(eie.write_domeinlijst(worksheet, 0, header)) expected = [ mock.call(0, 0, "Code"), mock.call(0, 1, "Test"), mock.call(1, 0, 1), mock.call(1, 1, "first line") ] self.assertEquals(worksheet.write.call_args_list, expected)
def test_false_if_wrong_fieldtype(self): self.assertFalse( eie.write_domeinlijst(None, 0, {'fieldtype': 'String'}))
def test_false_if_wrong_fieldtype(self): self.assertFalse(eie.write_domeinlijst( None, 0, {'fieldtype': 'String'}))
def test_false_if_wrong_fieldtype(self): self.assertFalse(eie.write_domeinlijst(None, 0, {"fieldtype": "String"}))