Skip to content

Commit

Permalink
Added github action for CI. (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosckital committed Jun 21, 2020
1 parent 10a782c commit efe98e8
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Continuous Integration

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Test the extension via shell script
run: bash ./tests/e2e.sh
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
mypy = "*"

[packages]

[requires]
python_version = "3.7"
82 changes: 82 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions tests/examples/ancestors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from typing import Type
from .person import Person


class Alice(Person):

def __init__(self):
super().__init__('Alice')


class Bob(Person):

def __init__(self):
super().__init__('Bob')


class Charlie(Person):

def __init__(self):
super().__init__('Charlie')

def eat(self):
super().eat()
print('{0} is eating again!'.format(self.name))


class CharlieSon(Charlie):
pass

class SuperMan():

def __init__(self, power: str):
super().__init__()
self.super_power = power

class CharlieGrandSon(SuperMan, CharlieSon):

def eat(self):
print('{0} is using {1} to eat.'.format(self.name, self.super_power))


c = Charlie()
c.eat()

b = Bob()
b.eat()

p: Type[Person] = Charlie()
p.eat()

cs = CharlieSon()
cs.name

cgs = CharlieGrandSon()
cgs.name
cgs.super_power
8 changes: 8 additions & 0 deletions tests/examples/person.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Person():

def __init__(self, name: str):
super().__init__()
self.name = name

def eat(self):
print('{0} is eating.'.format(self.name))

0 comments on commit efe98e8

Please sign in to comment.