def test_get_name(self): ws = MockWorkspace() expected_name = "TEST_WORKSPACE" ws.name = Mock(return_value=expected_name) model = TableWorkspaceDisplayModel(ws) self.assertEqual(expected_name, model.get_name())
def test_no_raise_with_supported_workspace(self): from mantid.simpleapi import CreateEmptyTableWorkspace ws = MockWorkspace() expected_name = "TEST_WORKSPACE" ws.name = Mock(return_value=expected_name) # no need to assert anything - if the constructor raises the test will fail TableWorkspaceDisplayModel(ws) ws = CreateEmptyTableWorkspace() TableWorkspaceDisplayModel(ws)