Skip to content

People-News is a Python news application that uses news API to display news from various sources. It allows the user to select a news source and see all news articles from the selected news source in the application.

License

Notifications You must be signed in to change notification settings

Charmain-Bonareri/People-News

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

import unittest

class Sources: ''' News Sources class to define news source objects '''

def __init__(self,id,name,category,description):
    self.id = id
    self.name = name
    self.category = category
    self.description = description

class TestSources(unittest.TestCase): ''' Test class that defines test cases for the Sources class behaviours.

Args:
    unittest.TestCase: TestCase class that helps in creating test cases
'''
def setUp(self):
    '''
    Set up method to run before each test cases.
    '''
    self.new_source = Sources("abc-news","ABC-NEWS","sports","") # create a source object


def test_init(self):
    '''
    test_init test case to test if the object is initialized properly
    '''

    self.assertEqual(self.new_source.id,"abc-news")
    self.assertEqual(self.new_source.name,"ABC-NEWS")
    self.assertEqual(self.new_source.category,"sports")
    self.assertEqual(self.new_source.description,"")

if name == 'main': unittest.main()

About

People-News is a Python news application that uses news API to display news from various sources. It allows the user to select a news source and see all news articles from the selected news source in the application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published