@staticmethod
PYL-R0201
94 # registration
95 assert isinstance(data["registration"], dict)
96
97 def test_not_necessary_field(self):
98 get_files = GetFiles()
99 all_files = get_files.get_group_files()
100 for org_file in all_files:
74class TestObjects:
75 # 1. Test require fields
76 # 2. Test other fields
77 def test_necessary_field(self):
78 get_files = GetFiles()
79 all_files = get_files.get_group_files()
80 for org_file in all_files:
49 else:
50 assert True, "Expected pytest.raises.Exception"
51
52 def test_indent(self):
53 get_files = GetFiles()
54 all_files = get_files.get_group_files()
55 for org_file in all_files:
37
38class TestFileFormat:
39
40 def test_isformat(self):
41 message = "TEST_MESSAGE"
42 try:
43 get_files = GetFiles()
16
17
18class GetFiles():
19 def get_group_files(self):
20 cmd = "find ~/ -name TGmeetup | sed -n '1p'"
21 output = subprocess.check_output(cmd, shell=True)
22 try:
The method doesn't use its bound instance. Decorate this method with @staticmethod
decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods here.