Best Python code snippet using autotest_python
DerivedTimeseriesFactory_test.py
Source:DerivedTimeseriesFactory_test.py
...81 timeseries = get_derived_timeseries(adjusted_url, ["G"], "adjusted", "minute")82 assert TimeseriesUtility.get_channels(timeseries) == ["G"]83 timeseries = get_derived_timeseries(adjusted_url, ["H", "D"], "adjusted", "minute")84 assert set(TimeseriesUtility.get_channels(timeseries)) == set(["H", "D"])85def test_get_missing():86 """test.DerivedTimeseriesFactory_test.test_get_missing()"""87 desired = ["X", "Y", "D", "G"]88 assert set(get_missing(input=Stream(), desired=desired)) == set(desired)89 desired = ["H", "E", "Z", "F"]90 timeseries = get_derived_timeseries(91 "etc/filter/BOU20200101vsec.sec", desired, "variation", "second"92 )93 assert get_missing(input=timeseries, desired=desired) == []94def get_derived_timeseries(95 url: str, channels: List[str], data_type: str, interval: str96) -> Stream:97 with open(url, "r") as file:98 return DerivedTimeseriesFactory(99 StreamIAGA2002Factory(stream=file)100 ).get_timeseries(...
test_storage.py
Source:test_storage.py
...14 assert len(Card.find_by_stack(80, session)) == 015class TestStack(object):16 def test_get(self, session, with_fixtures):17 assert Stack.get(3, session).label == IN_PLAY18 def test_get_missing(self, session):19 assert Stack.get(80, session) is None20class TestGame(object):21 def test_get(self, session, with_fixtures):22 assert Game.get(5, session).name == 'paused'23 def test_get_missing(self, session):...
DictUtilsTest.py
Source:DictUtilsTest.py
...9 }10 }11 }, 'a.b.c')12 self.assertEqual(1, out)13 def test_get_missing(self):14 out = DictUtils.get({15 'a': {16 'b': {17 'c': 118 }19 }20 }, 'a.f')21 self.assertIsNone(out)22 def test_get_none(self):23 out = DictUtils.get(None, 'a.f')24 self.assertIsNone(out)25 def test_set(self):26 obj = {}27 DictUtils.set(obj, 'a.b.c', 1)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!