Skip to content

Commit

Permalink
Merge pull request #5 from Kasulejoseph/tests
Browse files Browse the repository at this point in the history
Unittests
  • Loading branch information
Kasulejoseph committed Nov 14, 2019
2 parents a0970ac + 27a356e commit 9dde22f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 5 deletions.
1 change: 1 addition & 0 deletions .coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!coverage.py: This is a private format, don't read it directly!{"lines":{"/Users/kasule/Desktop/ug_dst/rwalocation/main.py":[4,6,7,9,10,15,19,24,27,37,11,12,13]}}
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = rwalocation/*__init__.py*
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_name: travis-pro
repo_token: hNQRU4lW5bJspVgvbN5ED9c3jfNrmFMNw
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: python

python:
- "3.6"

install:
- pip install -r requirements.txt
- pip install coveralls

script: coverage run --source rwalocation rwalocation/main.py

after_success:
coveralls
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Rwalocation
[![Build Status](https://travis-ci.com/Kasulejoseph/Ahantu.svg?branch=master)](https://travis-ci.com/Kasulejoseph/Ahantu)
[![Coverage Status](https://coveralls.io/repos/github/Kasulejoseph/Ahantu/badge.svg?branch=tests)](https://coveralls.io/github/Kasulejoseph/Ahantu?branch=tests)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8e6d206d92344ce881cc29241dea1929)](https://www.codacy.com/manual/Kasulejoseph/Ahantu?utm_source=github.com&utm_medium=referral&utm_content=Kasulejoseph/Ahantu&utm_campaign=Badge_Grade)
[![PyPI version](https://badge.fury.io/py/rwalocation.svg)](https://badge.fury.io/py/rwalocation)
> A Python library for listing locations in Rwanda
```
Expand Down
2 changes: 1 addition & 1 deletion rwalocation/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = "1.0"
__version__ = "1.1"

import requests
import operator
Expand Down
20 changes: 16 additions & 4 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@
# -*- coding: utf-8 -*-

import unittest
import ug-dst
from rwalocation.main import Province


class UnitTests(unittest.TestCase):
def setUp(self):
self.location = Province()

def test_import(self):
self.assertIsNotNone(ug-dst)
self.assertIsNotNone(self.location)

def test_list_districts(self):
self.assertIsInstance(self.location.district(), list)

def test_list_province_not_zero(self):
self.assertNotEqual(len(self.location.province()), 0)

def test_list_province_return_list(self):
self.assertIsInstance(self.location.province(), list)

def test_project(self):
self.assertTrue(False, "write more tests here")
def test_sort_by_district_return_an_array(self):
self.assertIsInstance(self.location.sort_by_district(), list)

0 comments on commit 9dde22f

Please sign in to comment.