Fix tests crash on travis

This commit is contained in:
Julien Duponchelle 2015-05-26 11:35:06 +02:00
parent dfd18f9483
commit c03c66ec48
2 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,6 @@ before_install:
- sudo add-apt-repository ppa:gns3/ppa -y
- sudo apt-get update -q
- sudo apt-get install dynamips
- sudo apt-get install python3-netifaces
install:
- python setup.py install

View File

@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import pytest
def test_udp_allocation(server, project):
response = server.post('/projects/{}/ports/udp'.format(project.id), {}, example=True)
@ -22,6 +25,8 @@ def test_udp_allocation(server, project):
assert response.json == {'udp_port': 10000}
# Netfifaces is not available on Travis
@pytest.skipif(os.environ.get("TRAVIS", False))
def test_interfaces(server):
response = server.get('/interfaces', example=True)
assert response.status == 200