Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisheksubu92 committed Dec 15, 2017
1 parent 4bfd1d0 commit 97f6a74
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 32 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added q01_read_data/.DS_Store
Binary file not shown.
Binary file added q01_read_data/tests/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions q01_read_data/tests/test_q01_read_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from q01_read_data.build import read_data

class TestRead_data(TestCase):
def test_read_data(self):
def test_read_data_return_instance(self):
result = read_data()
self.assertIsInstance(result, dict)
self.assertIsInstance(result, dict,"The expected instance does not match with the return instance")
Binary file added q02_teams/.DS_Store
Binary file not shown.
Binary file added q02_teams/tests/.DS_Store
Binary file not shown.
20 changes: 13 additions & 7 deletions q02_teams/tests/test_q02 _teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
from greyatomlib.python_getting_started.q01_read_data.build import read_data
from q02_teams.build import teams

data = read_data()
ipl_teams = teams(data)

class TestTeams(TestCase):
def test_teams(self):
data = read_data()
ipl_teams = teams(data)
self.assertIsInstance(ipl_teams, list)
self.assertTrue('Royal Challengers Bangalore' in ipl_teams)
self.assertTrue('Kolkata Knight Riders' in ipl_teams)
self.assertTrue(len(ipl_teams) == 2)
def test_teams_return_type(self):
self.assertIsInstance(ipl_teams, list,"Expected type does not match the return type")

def test_teams_return_Royal_Challengers(self):
self.assertTrue('Royal Challengers Bangalore' in ipl_teams,"Expected team does not match with the return team")

def test_teams_return_Knight_Riders(self):
self.assertTrue('Kolkata Knight Riders' in ipl_teams,"Expected team does not match with the return team")

def test_teams_return_number_of_teams(self):
self.assertEqual(len(ipl_teams),2,"The expected number of teams does not ")
Binary file added q03_first_batsman/.DS_Store
Binary file not shown.
Binary file added q03_first_batsman/tests/.DS_Store
Binary file not shown.
12 changes: 8 additions & 4 deletions q03_first_batsman/tests/test_q03_first_batsman.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
from greyatomlib.python_getting_started.q01_read_data.build import read_data
from q03_first_batsman.build import first_batsman

data = read_data()
batsman_name = first_batsman(data)

class TestFirst_batsman(TestCase):
def test_first_batsman(self):
data = read_data()
batsman_name = first_batsman(data)
def test_first_batsman_return_type(self):

self.assertIsInstance(batsman_name, str)
self.assertTrue('SC Ganguly' == batsman_name)

def test_first_batsman_return_value(self):
self.assertEqual('SC Ganguly',batsman_name,"The Expected name does not match with the returned name")
Binary file added q04_count/.DS_Store
Binary file not shown.
Binary file added q04_count/tests/.DS_Store
Binary file not shown.
11 changes: 7 additions & 4 deletions q04_count/tests/test_q04_deliveries_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
from greyatomlib.python_getting_started.q01_read_data.build import read_data
from q04_count.build import deliveries_count

data = read_data()
nos_of_delivery = deliveries_count(data)

class TestDeliveries_count(TestCase):
def test_deliveries_count(self):
data = read_data()
nos_of_delivery = deliveries_count(data)
def test_deliveries_count_return_type(self):

self.assertIsInstance(nos_of_delivery, int)
self.assertTrue(20 == nos_of_delivery)
def test_deliveries_count_return_values(self):
self.assertEqual(20 , nos_of_delivery,"The Expected value does not match the return value")
Binary file added q05_runs/.DS_Store
Binary file not shown.
Binary file added q05_runs/tests/.DS_Store
Binary file not shown.
14 changes: 9 additions & 5 deletions q05_runs/tests/test_q05_BC_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
from unittest import TestCase
from greyatomlib.python_getting_started.q01_read_data.build import read_data
from q05_runs.build import BC_runs
data= read_data()
McCullum_runs = BC_runs(data)


class TestBC_runs(TestCase):
def test_BC_runs(self):
data= read_data()
McCullum_runs = BC_runs(data)
self.assertIsInstance(McCullum_runs, int)
self.assertTrue(158 == McCullum_runs)
def test_BC_runs_return_type(self):

self.assertIsInstance(McCullum_runs, int,"The Expected type does not match the return type")

def test_BC_runs_return_values(self):
self.assertEqual(158 , McCullum_runs,"The Expected value does not match the return value")
Binary file added q06_bowled_players/.DS_Store
Binary file not shown.
Binary file added q06_bowled_players/tests/.DS_Store
Binary file not shown.
14 changes: 9 additions & 5 deletions q06_bowled_players/tests/test_q06_bowled_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
from unittest import TestCase
from q06_bowled_players.build import bowled_out
from greyatomlib.python_getting_started.q01_read_data.build import read_data

data = read_data()
bowled_out_players = bowled_out(data)
class TestBowled_out(TestCase):
def test_bowled_out(self):
data = read_data()
bowled_out_players = bowled_out(data)
self.assertIsInstance(bowled_out_players, list)
self.assertSetEqual(set(bowled_out_players), set(['R Dravid', 'V Kohli', 'Z Khan']))
def test_bowled_out_return_type(self):

self.assertIsInstance(bowled_out_players, list,"The Expected type does not match return type")

def test_bowled_out_return_value(self):
self.assertSetEqual(set(bowled_out_players), set(['R Dravid', 'V Kohli', 'Z Khan']),"The Expected Value does not match return value")
Binary file added q07_extras/.DS_Store
Binary file not shown.
Binary file added q07_extras/tests/.DS_Store
Binary file not shown.
15 changes: 10 additions & 5 deletions q07_extras/tests/test_q07_extras_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
from unittest import TestCase
from greyatomlib.python_getting_started.q01_read_data.build import read_data
from q07_extras.build import extras_runs

data = read_data()
extras = extras_runs(data)

class TestExtras_runs(TestCase):
def test_extras_runs(self):
data = read_data()
extras = extras_runs(data)
self.assertIsInstance(extras, int)
self.assertTrue(6 == extras)
def test_extras_runs_return_type(self):

self.assertIsInstance(extras, int,"Expected type does not match the return type")

def test_extras_runs_return_values(self):
self.assertEqual(extras,6,"The Expected value does not match the return value")

0 comments on commit 97f6a74

Please sign in to comment.