Best Python code snippet using avocado_python
setup.py
Source:setup.py
1from setuptools import setup, find_packages2def readme():3 with open("README.md") as f:4 return f.read()5setup(6 name="transmission_helper",7 version="0.2a",8 python_requires=">=3.5",9 description="""The program that will take care10 of my transmission setup""",11 long_description=readme(),12 url="https://github.com/Scheercuzy/transmission_helper",13 author="MX",14 author_email="maxi730@gmail.com",15 license="MIT",16 packages=find_packages(),17 include_package_data=True,18 install_requires=[19 "appdirs==1.4.4",20 "apscheduler==3.6.3",21 "attrs==20.2.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",22 "black==19.10b0; python_version >= '3.6'",23 "cached-property==1.5.2",24 "cerberus==1.3.2",25 "certifi==2020.6.20",26 "chardet==3.0.4",27 "click==7.1.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",28 "colorama==0.4.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",29 "distlib==0.3.1",30 "flask==1.1.2",31 "idna==2.10; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",32 "importlib-metadata==2.0.0; python_version < '3.8'",33 "itsdangerous==1.1.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",34 "jinja2==2.11.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",35 "markupsafe==1.1.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",36 "orderedmultidict==1.0.1",37 "packaging==20.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",38 "pathspec==0.8.0",39 "pep517==0.9.1",40 "pip-shims==0.5.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",41 "pipenv-setup==3.1.1",42 "pipfile==0.0.2",43 "plette[validation]==0.2.3; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'",44 "pyparsing==2.4.7; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'",45 "python-dateutil==2.8.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",46 "pytz==2020.1",47 "pyyaml==5.3.1",48 "regex==2020.10.15",49 "requests==2.24.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",50 "requirementslib==1.5.13; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",51 "six==1.15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",52 "toml==0.10.1",53 "tomlkit==0.7.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",54 "transmissionrpc==0.11",55 "typed-ast==1.4.1",56 "typing==3.7.4.3; python_version < '3.7'",57 "tzlocal==2.1",58 "urllib3==1.25.11; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",59 "uwsgi==2.0.19.1",60 "vistir==0.5.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",61 "werkzeug==1.0.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",62 "wheel==0.35.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",63 "zipp==3.3.1; python_version < '3.8'",64 ],65 entry_points={66 "console_scripts": ["transmission_helper = transmission_helper.__main__:main"]67 },...
test_python_version.py
Source:test_python_version.py
1#!/usr/bin/env python2#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-3from bes.testing.unit_test import unit_test4from bes.python.python_version import python_version5class test_python_version(unit_test):6 def test___str__(self):7 self.assertEqual( '1.2.3', str(python_version('1.2.3')) )8 self.assertEqual( '1.2', str(python_version('1.2')) )9 self.assertEqual( '1', str(python_version('1')) )10 def test___len__(self):11 self.assertEqual( 3, len(python_version('1.2.3')) )12 self.assertEqual( 2, len(python_version('1.2')) )13 self.assertEqual( 1, len(python_version('1')) )14 def test___eq__(self):15 self.assertTrue( python_version('1.2.3') == python_version('1.2.3') )16 self.assertFalse( python_version('1.2.3') == python_version('1.2.4') )17 18 def test_parts(self):19 self.assertEqual( ( 1, 2, 3 ), python_version('1.2.3').parts )20 self.assertEqual( ( 1, 2 ), python_version('1.2').parts )21 self.assertEqual( ( 1, ), python_version('1').parts )22 def test_major_version(self):23 self.assertEqual( python_version('1'), python_version('1.2.3').major_version )24 self.assertEqual( python_version('1'), python_version('1.2').major_version )25 self.assertEqual( python_version('1'), python_version('1').major_version )26 27 def test_version(self):28 self.assertEqual( python_version('1.2'), python_version('1.2.3').version )29 self.assertEqual( python_version('1.2'), python_version('1.2').version )30 31 def test_full_version(self):32 self.assertEqual( python_version('1.2.3'), python_version('1.2.3').full_version )33 34 def test_is_version(self):35 self.assertTrue( python_version('6.7').is_version() )36 self.assertFalse( python_version('6.7.8').is_version() )37 def test_is_full_version(self):38 self.assertTrue( python_version('6.7.8').is_full_version() )39 self.assertFalse( python_version('6.7').is_full_version() )40 def test_is_major_version(self):41 self.assertTrue( python_version('6').is_major_version() )42 self.assertFalse( python_version('6.7.8').is_major_version() )43 self.assertFalse( python_version('6.7').is_major_version() )44 45 def test_major(self):46 self.assertEqual( 6, python_version('6').major )47 self.assertEqual( 6, python_version('6.7').major )48 self.assertEqual( 6, python_version('6.8').major )49 def test_join_parts(self):50 self.assertEqual( '6', python_version('6').join_parts('') )51 self.assertEqual( '67', python_version('6.7').join_parts('') )52 self.assertEqual( '678', python_version('6.7.8').join_parts('') )53 54if __name__ == '__main__':...
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!!