How to use _make method in autotest

Best Python code snippet using autotest_python

units.py

Source:units.py Github

copy

Full Screen

...149Femto = 1.e-15150Atto = 1.e-18151Zepto = 1.e-21152Yocto = 1.e-24153def _make(unit,name):154 unit.name = name155 return unit156### Conveniences and metric prefixes157squareMeter = _make(meter ** 2, "squareMeter")158cubicMeter = _make(meter ** 3, "cubicMeter")159# don't know the official metric names for these, if such exist160speed = meter / second161acceleration = speed / second162density = kilogram / cubicMeter163liter = L = _make(Milli * cubicMeter, "liter")164newton = N = _make(kilogram * acceleration, "newton")165joule = J = _make(newton * meter, "joule")166watt = W = _make(joule / second, "watt")167ampere = A = _make(coulomb / second, "ampere")168volt = V = _make(joule / coulomb, "volt")169ohm = _make(volt / ampere, "ohm")170farad = F = _make(coulomb / volt, "farad")171weber = Wb = _make(volt * second, "weber")172tesla = T = _make(weber / squareMeter, "tesla")173pascal = P = _make(newton / squareMeter, "pascal")174henry = H = _make(weber / ampere, "henry")175calorie = cal = _make(4.1868 * joule, "calorie")176kilocalorie = kcal = _make(Kilo * calorie, "kcal")177km = _make(Kilo * meter, "km")178cm = _make(Centi * meter, "cm")179mm = _make(Milli * meter, "mm")180um = _make(Micro * meter, "um")181nm = _make(Nano * meter, "nm")182are = _make(100 * squareMeter, "are")183hectare = _make(Hecto * are, "hectare")184gram = g = _make(Milli * kilogram, "gram")185mgram = mg = _make(Micro * kilogram, "mgram")186ugram = ug = _make(Nano * kilogram, "ugram")187metricTon = tonne = _make(Kilo * kilogram, "tonne")188A = _make(ampere, "A")189mA = _make(Milli * ampere, "mA")190uA = _make(Micro * ampere, "uA")191nA = _make(Nano * ampere, "nA")192pA = _make(Pico * ampere, "pA")193msec = _make(Milli * second, "msec")194usec = _make(Micro * second, "usec")195nsec = _make(Nano * second, "nsec")196psec = _make(Pico * second, "psec")197fsec = _make(Femto * second, "fsec")198ksec = _make(Kilo * second, "ksec")199Msec = _make(Mega * second, "Msec")200Gsec = _make(Giga * second, "Gsec")201Tsec = _make(Tera * second, "Tsec")202uF = _make(Micro * farad, "uF")203nF = _make(Nano * farad, "nF")204pF = _make(Pico * farad, "pF")205mH = _make(Milli * henry, "mH")206uH = _make(Micro * henry, "uH")207nH = _make(Nano * henry, "nH")208Kohm = _make(Kilo * ohm, "Kohm")209Mohm = _make(Mega * ohm, "Mohm")210# earthGravity = 9.8 * acceleration211gravitationalConstant = 6.67300e-11 * m**3 * kg**-1 * sec**-2212earthMass = 5.9742e24 * kg213earthRadius = 6378.1 * km214earthGravity = gravitationalConstant * earthMass / earthRadius**2215### Electrostatics216electronCharge = 1.60217733e-19 * coulomb217electrostaticConstant = 8.98755e9 * (N * m**2) / (coulomb**2)218### Time219minute = _make(60 * second, "minute")220hour = _make(60 * minute, "hour")221day = _make(24 * hour, "day")222week = _make(7 * day, "week")223year = _make(365.25 * day, "year")224# There is some disagreement on years. These are Julian years.225# Gregorian years are 365.2425 days, and tropical years are 365.24219226# days.227month = _make(year / 12, "month")228# 28, 29, 30, 31... obviously months must be approximate229decade = _make(10 * year, "decade")230century = _make(100 * year, "century")231millenium = _make(1000 * year, "millenium")232### English measures233inch = _make(.0254 * meter, "inch")234foot = _make(12 * inch, "foot")235yard = _make(3 * foot, "yard")236furlong = _make(660 * foot, "furlong")237mile = _make(5280 * foot, "mile")238squareMile = _make(mile ** 2, "squareMile")239acre = _make(43560 * foot**2, "acre")240MPH = _make(mile / hour, "MPH")241MPS = _make(mile / second, "MPS")242gallon = _make(3.79 * liter, "gallon")243quart = _make(.25 * gallon, "quart")244pint = _make(.5 * quart, "pint")245cup = _make(.5 * pint, "cup")246fluid_ounce = _make(.125 * cup, "fluid_ounce")247tablespoon = _make(.5 * fluid_ounce, "tablespoon")248teaspoon = _make(tablespoon / 3., "teaspoon")249# In the English system, should we express weights in terms of250# masses? Or should we multiply masses by 32 feet/sec^2?251ounce = oz = earthGravity * (28.35 * gram)252pound = lb = 16 * ounce253slug = 14.5939 * kg254stone = 6.3503 * kg255if __name__ == "__main__":256 def test1():257 lists = [ [ "Length",258 inch,259 furlong,260 yard,261 mile,262 km...

Full Screen

Full Screen

mediawikiversion_tests.py

Source:mediawikiversion_tests.py Github

copy

Full Screen

...11from tests.aspects import unittest, TestCase12class TestMediaWikiVersion(TestCase):13 """Test MediaWikiVersion class comparisons."""14 net = False15 def _make(self, version):16 """Create a MediaWikiVersion instance and check that the str stays."""17 v = V(version)18 self.assertEqual(str(v), version)19 return v20 def test_normal_versions(self):21 """Test comparison between release versions."""22 self.assertGreater(self._make('1.23'), self._make('1.22.0'))23 self.assertTrue(self._make('1.23') == self._make('1.23'))24 self.assertEqual(self._make('1.23'), self._make('1.23'))25 def test_wmf_versions(self):26 """Test comparison between wmf versions."""27 self.assertGreater(self._make('1.23wmf10'), self._make('1.23wmf9'))28 self.assertEqual(self._make('1.23wmf10'), self._make('1.23wmf10'))29 def test_combined_versions(self):30 """Test comparison between wmf versions and release versions."""31 self.assertGreater(self._make('1.23wmf10'), self._make('1.22.3'))32 self.assertGreater(self._make('1.23'), self._make('1.23wmf10'))33 def test_non_wmf_scheme(self):34 """Test version numbers not following the wmf-scheme."""35 self.assertGreater(self._make('1.23alpha'), self._make('1.22.3'))36 self.assertGreater(self._make('1.23alpha'), self._make('1.23wmf1'))37 self.assertGreater(self._make('1.23beta1'), self._make('1.23alpha'))38 self.assertGreater(self._make('1.23beta2'), self._make('1.23beta1'))39 self.assertGreater(self._make('1.23-rc.1'), self._make('1.23beta2'))40 self.assertGreater(self._make('1.23-rc.2'), self._make('1.23-rc.1'))41 self.assertGreater(self._make('1.23'), self._make('1.23-rc.2'))42 self.assertEqual(self._make('1.23rc1'), self._make('1.23-rc.1'))43 def _version_check(self, version, digits, dev_version, suffix):44 v = self._make(version)45 self.assertEqual(v.version, digits)46 self.assertEqual(v._dev_version, dev_version)47 self.assertEqual(v.suffix, suffix)48 def test_interpretation(self):49 """Test if the data is correctly interpreted."""50 self._version_check('1.23', (1, 23), (4, ), '')51 self._version_check('1.23wmf1', (1, 23), (0, 1), 'wmf1')52 self._version_check('1.23alpha', (1, 23), (1, ), 'alpha')53 self._version_check('1.23beta1', (1, 23), (2, 1), 'beta1')54 self._version_check('1.23rc1', (1, 23), (3, 1), 'rc1')55 self._version_check('1.23-rc1', (1, 23), (3, 1), '-rc1')56 self._version_check('1.23-rc.1', (1, 23), (3, 1), '-rc.1')57 def test_invalid_versions(self):58 """Verify that insufficient version fail creating."""...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful