Skip to content

Commit

Permalink
yov
Browse files Browse the repository at this point in the history
  • Loading branch information
Can Özyurt committed Jul 4, 2022
1 parent b7864aa commit 2c6b750
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ on:
pull_request:

jobs:
setup:
runs-on: ubuntu-latest
units:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
version: [2.9, '3.0', 3.1, 3.2, master]
include:
- os: ubuntu-18.04
version: 2.8
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up libvirt
run: which lxd
- uses: actions/checkout@v3
- name: Clone MAAS repository
run: git clone https://git.launchpad.net/maas -b ${{ matrix.version }} --depth 1
- name: Install MAAS dependencies
run: (cd ./maas && sudo make install-dependencies && sudo pip3 install -r requirements-dev.txt)
- name: pip freeze
run: pip3 freeze
- name: Run test
run: sudo python3 -m unittest test.py
19 changes: 19 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import django
import os
import unittest
from requests import Request

os.environ.setdefault("DJANGO_SETTINGS_MODULE","maasserver.djangosettings.development")
django.setup()

from maasserver.api.domains import DomainsHandler
from maasserver.testing.testcase import MAASServerTestCase


class DomainsHandlerTests(MAASServerTestCase):
def test_domain_create(self):
data = {"name": "adfasf"}
request = Request('POST', 'localhost', data=data)
request.user = type("User", (), {"is_superuser": True})
handler = DomainsHandler()
handler.create(request=request)

0 comments on commit 2c6b750

Please sign in to comment.