├── .circleci └── config.yml ├── README.md ├── __pycache__ └── main.cpython-39.pyc ├── main.py └── tests.py /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | jobs: 4 | build: 5 | docker: 6 | - image: cimg/python:3.11 7 | steps: 8 | - checkout 9 | - run: python main.py 10 | test: 11 | docker: 12 | - image: cimg/python:3.11 13 | steps: 14 | - checkout 15 | - run: python tests.py 16 | deploy: 17 | docker: 18 | - image: cimg/python:3.11 19 | steps: 20 | - run: echo "Deploying to production server" 21 | 22 | workflows: 23 | build_and_test_deploy: 24 | jobs: 25 | - build 26 | - test: 27 | requires: 28 | - build 29 | - deploy: 30 | requires: 31 | - test 32 | filters: 33 | branches: 34 | only: main -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Python - CircleCI 2 | 3 | ### Run the code 4 | ``` 5 | python main.py 6 | ``` 7 | 8 | ### Test the code 9 | ``` 10 | python tests.py 11 | ``` -------------------------------------------------------------------------------- /__pycache__/main.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LondheShubham153/CircleCi-python/7e815c75d00d6bbc2feb2e3fd228060ae932cf58/__pycache__/main.cpython-39.pyc -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | def to_upper(name): 2 | return name.upper() 3 | 4 | 5 | def say_hello(name): 6 | # Use a breakpoint in the code line below to debug your script. 7 | print(f'Hello, {name}') # Press ⌘F8 to toggle the breakpoint. 8 | 9 | 10 | # Press the green button in the gutter to run the script. 11 | if __name__ == '__main__': 12 | name = 'TrainWithShubham' 13 | say_hello(name) 14 | up = to_upper(name) 15 | print(up) -------------------------------------------------------------------------------- /tests.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from main import to_upper 3 | 4 | 5 | class MyTestCase(unittest.TestCase): 6 | def test_to_upper(self): 7 | name = "Shubham" 8 | upper_name = to_upper(name) 9 | self.assertEqual(upper_name, "SHUBHAM") 10 | 11 | 12 | if __name__ == '__main__': 13 | unittest.main() --------------------------------------------------------------------------------