Skip to content

new #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2018
Merged

new #132

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions q01_zeros_array/tests/test_q01_zeros_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from q01_zeros_array.build import array_zeros
var = array_zeros()


class TestZeros_array(TestCase):
def test_zeros_array_return_shape(self):

self.assertTrue(var.shape==(3,4,2),'Expected Shape does not match return shape')
self.assertTrue(var.shape == (3, 4, 2), 'Expected Shape does not match return shape')

def test_zeros_array_return_value_max(self):
self.assertTrue(var.max()==0,'Expected value does not match return value')
self.assertTrue(var.max() == 0, 'Expected value does not match return value')
2 changes: 1 addition & 1 deletion q02_zeros_reshaped/tests/test_q02_zeros_array_reshaped.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
class TestZeros_array_reshaped(TestCase):
def test_zeros_array_reshaped_return_shape(self):
var = array_reshaped_zeros()
self.assertTrue(var.shape == (2,3,4),"The Expected shape does not match the return shape")
self.assertTrue(var.shape == (2,3,4),"The Expected shape does not match the return shape")
5 changes: 2 additions & 3 deletions q03_create_3d_array/tests/test_q03_create_3d_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
]
arr = create_3d_array()


class TestCreate_3d_array(TestCase):
def test_create_3d_array_return_value(self):


self.assertTrue(np.all(arr == actual),"The Expected array does not match returned array")
self.assertTrue(np.all(arr == actual), "The Expected array does not match returned array")
8 changes: 5 additions & 3 deletions q04_read_csv_data_to_ndarray/tests/test_q04_read_ipl_data.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.curdir)))
from inspect import getargspec
from inspect import getfullargspec
from unittest import TestCase
import numpy as np
from q04_read_csv_data_to_ndarray.build import read_csv_data_to_ndarray
input_dtype = '|S100'
ipl_array = read_csv_data_to_ndarray("data/ipl_matches_small.csv", input_dtype)


class TestRead_ipl_data(TestCase):
def test_read_ipl_data_arguments(self):
args = getargspec(read_csv_data_to_ndarray)
args = getfullargspec(read_csv_data_to_ndarray)
self.assertEqual(len(args[0]),2,"Expected number of arguments does not match the arguments in the solution")

def test_read_ipl_data_return_shape(self):
self.assertTrue(ipl_array.shape == (1451, 23),"The Expected shape does not match the returned shape")

def test_read_ipl_data_return_type(self):
self.assertTrue(ipl_array.dtype == input_dtype,"The Expected dtype does not match the returned dtype")
self.assertTrue(ipl_array.dtype == input_dtype,"The Expected dtype does not match the returned dtype")
8 changes: 4 additions & 4 deletions q05_read_csv_data/tests/test_q05_read_ipl_data_csv.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import sys, os
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.curdir)))

from unittest import TestCase
from q05_read_csv_data.build import read_ipl_data_csv

ipl_matches_array = read_ipl_data_csv('data/ipl_matches_small.csv', dtype='|S50')


class TestRead_ipl_data(TestCase):
def test_read_ipl_data_return_shape(self):

self.assertTrue(ipl_matches_array.shape == (1451, 23),"The Expected shape does not match the return shape")
self.assertTrue(ipl_matches_array.shape == (1451, 23), "The Expected shape does not match the return shape")

def test_read_ipl_data_return_dtype(self):
self.assertTrue(ipl_matches_array.dtype == '|S50',"The Expectd dtype does not match the return dtype")
self.assertTrue(ipl_matches_array.dtype == '|S50', "The Expectd dtype does not match the return dtype")
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from q06_get_unique_matches_count.build import get_unique_matches_count



class TestGet_unique_matches_count(TestCase):
def test_get_unique_matches_count(self):
matches_count = get_unique_matches_count()
self.assertTrue(matches_count == 6,"The Expected count does not match the return count")

self.assertTrue(matches_count == 6,"The Expected count does not match the return count")
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
class TestGet_unique_teams_set(TestCase):
def test_get_unique_teams_set_return(self):
teams = get_unique_teams_set()
actual = {'Chennai Super Kings', 'Deccan Chargers', 'Kings XI Punjab', 'Kolkata Knight Riders',
'Mumbai Indians', 'Pune Warriors', 'Rajasthan Royals'}
self.assertTrue(teams == actual,"The Expected teams do not match the actual teams")
actual = {b'Deccan Chargers', b'Kings XI Punjab', b'Chennai Super Kings', b'Mumbai Indians',
b'Rajasthan Royals', b'Pune Warriors', b'Kolkata Knight Riders'}
self.assertEqual(teams, actual, "The Expected teams do not match the actual teams")
1 change: 0 additions & 1 deletion q08_get_total_extras/tests/test_q08_get_total_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ class TestGet_total_extras(TestCase):
def test_get_total_extras_return_values(self):
runs = get_total_extras()
self.assertTrue(runs == 88,"The Expected value does not match return value")