-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added muon difference and muon base test files. Removed unnecessary tests
- Loading branch information
1 parent
90aef2c
commit 748638c
Showing
5 changed files
with
50 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Mantid Repository : https://github.com/mantidproject/mantid | ||
# | ||
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, | ||
# NScD Oak Ridge National Laboratory, European Spallation Source, | ||
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
# SPDX - License - Identifier: GPL - 3.0 + | ||
import unittest | ||
|
||
from Muon.GUI.Common.muon_base import MuonBase | ||
|
||
|
||
class MuonBaseTest(unittest.TestCase): | ||
""" | ||
The MuonBase object encapsulates the basic information that describes a group or pair: | ||
""" | ||
|
||
def test_cannot_initialize_without_name(self): | ||
with self.assertRaises(TypeError): | ||
MuonBase() | ||
|
||
def test_name_is_set_correctly(self): | ||
muon_base = MuonBase("base") | ||
self.assertEqual(muon_base.name, "base") | ||
|
||
def test_that_cannot_set_new_name(self): | ||
muon_base = MuonBase("base") | ||
|
||
with self.assertRaises(AttributeError): | ||
muon_base.name = "new_name" | ||
self.assertEqual(muon_base.name, "base") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Mantid Repository : https://github.com/mantidproject/mantid | ||
# | ||
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, | ||
# NScD Oak Ridge National Laboratory, European Spallation Source, | ||
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
# SPDX - License - Identifier: GPL - 3.0 + | ||
import unittest | ||
|
||
from Muon.GUI.Common.muon_group import MuonDiff | ||
|
||
|
||
class MuonDifferenceTest(unittest.TestCase): | ||
|
||
def test_that_cannot_initialize_MuonDiff_without_name(self): | ||
with self.assertRaises(TypeError): | ||
MuonDiff() | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(buffer=False, verbosity=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters