Skip to content

Commit

Permalink
Merge pull request #64 from mfesiem/develop
Browse files Browse the repository at this point in the history
Event fields update and fixes
  • Loading branch information
tristanlatr authored Jan 21, 2020
2 parents 4461685 + bec1769 commit e208f2e
Show file tree
Hide file tree
Showing 6 changed files with 687 additions and 373 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,31 @@
name: test
on:
push:
branches:
- master
- develop
on: pull_request
jobs:
test:
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.7']
python-version: ['3.5','3.6','3.7','3.8']
max-parallel: 1
fail-fast: false
steps:
- uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ./
- name: Setup msiempy config
run: python ./samples/msiempy_setup.py --set esm host 207.179.200.58:4443 --set esm user NGCP --set esm passwd ${{ secrets.esmpass }} --set general logfile ./log.txt --set general timeout 60

- name: Run tests and print output
run: |
pytest --cov=./ --cov-report=xml --reruns 5 --reruns-delay 1
echo "OUTPUT ================================== OUTPUT ================================== OUTPUT"
cat ./log.txt | grep -v DEBUG
echo "DEBUG ================================== DEBUG ================================== DEBUG"
cat ./log.txt
- name: Upload coverage to Codecov
run: python ./samples/msiempy_setup.py --set esm host 207.179.200.58:4443 --set esm user NGCP --set esm passwd ${{ secrets.esmpass }} --set general timeout 60
- name: Run tests
run: pytest --cov=./ --cov-report=xml --reruns 5 --reruns-delay 1
- name: Upload code coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/ubuntu_py3.6_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ubuntu py3.6 test
on: push
jobs:
test:
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.6']
max-parallel: 1
fail-fast: false
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ./
- name: Setup msiempy config
run: python ./samples/msiempy_setup.py --set esm host 207.179.200.58:4443 --set esm user NGCP --set esm passwd ${{ secrets.esmpass }} --set general timeout 60
- name: Run tests
run: pytest --cov=./ --cov-report=xml --reruns 5 --reruns-delay 1
- name: Upload code coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
name: msiempy-code-coverage
yml: ./codecov.yml
fail_ci_if_error: true

15 changes: 4 additions & 11 deletions msiempy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,12 +1098,9 @@ class NitroDict(collections.UserDict, NitroObject):
def __init__(self, adict=None, id=None):
NitroObject.__init__(self)
collections.UserDict.__init__(self, adict)

if id != None :
self.data=self.data_from_id(id)

if isinstance(adict, dict):
self.data=adict
if adict : self.data=adict
if id : self.data=self.data_from_id(id)

for key in list(self) :
if isinstance(self[key], list):
Expand Down Expand Up @@ -1156,18 +1153,14 @@ class NitroList(collections.UserList, NitroObject):

def __init__(self, alist=None):
NitroObject.__init__(self)
if alist is None:
collections.UserList.__init__(self, [])

elif isinstance(alist , (list, NitroList)):
if alist :
collections.UserList.__init__(
self, alist
#[NitroDict(adict=item) for item in alist if isinstance(item, (dict, NitroDict))]
#Can't instanciate NitroDict, so Concrete classes have to cast the items afterwards!
#TODO better polymorphism to cast every sub-NitroList class's item dynamcally !
)
else :
raise ValueError('NitroList can only be initiated based on a list')
else : collections.UserList.__init__(self, [])

def __str__(self):
"""str(obj) -> return text string.
Expand Down
2 changes: 1 addition & 1 deletion msiempy/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Project version.
"""
__version__='0.2.1'
__version__='0.2.2'
Loading

0 comments on commit e208f2e

Please sign in to comment.