import unittest
import classify


class TestExclude(unittest.TestCase):

    def getData(self):
        fname = open("marks.dat")
        boundaries = list(map(int, ['0', '49', '59', '60', '69', '74', '100']))
        return fname, boundaries

    def test_getdata(self):
        fname, boundaries = self.getData()
        data = classify.getData(fname)
        fname.close()

        fname = open("marks.dat")
        counter = 0
        for line in fname:
            counter += 1
        fname.close()
        self.assertEqual(len(data), counter)

    def test_ranges_1(self):
        data = [['AC008128', 73],['AC019221', 38],['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 20)
        self.assertEqual(ranges,["none"])

    def test_ranges_2(self):
        data = [['AC008128', 73],['AC019221', 38],['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 49)
        self.assertEqual(ranges,['AC019221'])

    def test_ranges_3(self):
        data = [['AC008128', 73],['AC019221', 38],['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 60)
        self.assertEqual(ranges,['AC019221','AB040731'])

if __name__ == '__main__':
    unittest.main()

0e79946481021f346fcdb7e49b7768e1649cfc45
<mask token>


class TestExclude(unittest.TestCase):
    <mask token>

    def test_getdata(self):
        fname, boundaries = self.getData()
        data = classify.getData(fname)
        fname.close()
        fname = open('marks.dat')
        counter = 0
        for line in fname:
            counter += 1
        fname.close()
        self.assertEqual(len(data), counter)

    def test_ranges_1(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 20)
        self.assertEqual(ranges, ['none'])
    <mask token>

    def test_ranges_3(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 60)
        self.assertEqual(ranges, ['AC019221', 'AB040731'])


<mask token>

<mask token>


class TestExclude(unittest.TestCase):

    def getData(self):
        fname = open('marks.dat')
        boundaries = list(map(int, ['0', '49', '59', '60', '69', '74', '100']))
        return fname, boundaries

    def test_getdata(self):
        fname, boundaries = self.getData()
        data = classify.getData(fname)
        fname.close()
        fname = open('marks.dat')
        counter = 0
        for line in fname:
            counter += 1
        fname.close()
        self.assertEqual(len(data), counter)

    def test_ranges_1(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 20)
        self.assertEqual(ranges, ['none'])

    def test_ranges_2(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 49)
        self.assertEqual(ranges, ['AC019221'])

    def test_ranges_3(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 60)
        self.assertEqual(ranges, ['AC019221', 'AB040731'])


<mask token>

<mask token>


class TestExclude(unittest.TestCase):

    def getData(self):
        fname = open('marks.dat')
        boundaries = list(map(int, ['0', '49', '59', '60', '69', '74', '100']))
        return fname, boundaries

    def test_getdata(self):
        fname, boundaries = self.getData()
        data = classify.getData(fname)
        fname.close()
        fname = open('marks.dat')
        counter = 0
        for line in fname:
            counter += 1
        fname.close()
        self.assertEqual(len(data), counter)

    def test_ranges_1(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 20)
        self.assertEqual(ranges, ['none'])

    def test_ranges_2(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 49)
        self.assertEqual(ranges, ['AC019221'])

    def test_ranges_3(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 60)
        self.assertEqual(ranges, ['AC019221', 'AB040731'])


if __name__ == '__main__':
    unittest.main()

import unittest
import classify


class TestExclude(unittest.TestCase):

    def getData(self):
        fname = open('marks.dat')
        boundaries = list(map(int, ['0', '49', '59', '60', '69', '74', '100']))
        return fname, boundaries

    def test_getdata(self):
        fname, boundaries = self.getData()
        data = classify.getData(fname)
        fname.close()
        fname = open('marks.dat')
        counter = 0
        for line in fname:
            counter += 1
        fname.close()
        self.assertEqual(len(data), counter)

    def test_ranges_1(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 20)
        self.assertEqual(ranges, ['none'])

    def test_ranges_2(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 49)
        self.assertEqual(ranges, ['AC019221'])

    def test_ranges_3(self):
        data = [['AC008128', 73], ['AC019221', 38], ['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 60)
        self.assertEqual(ranges, ['AC019221', 'AB040731'])


if __name__ == '__main__':
    unittest.main()

import unittest
import classify


class TestExclude(unittest.TestCase):

    def getData(self):
        fname = open("marks.dat")
        boundaries = list(map(int, ['0', '49', '59', '60', '69', '74', '100']))
        return fname, boundaries

    def test_getdata(self):
        fname, boundaries = self.getData()
        data = classify.getData(fname)
        fname.close()

        fname = open("marks.dat")
        counter = 0
        for line in fname:
            counter += 1
        fname.close()
        self.assertEqual(len(data), counter)

    def test_ranges_1(self):
        data = [['AC008128', 73],['AC019221', 38],['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 20)
        self.assertEqual(ranges,["none"])

    def test_ranges_2(self):
        data = [['AC008128', 73],['AC019221', 38],['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 49)
        self.assertEqual(ranges,['AC019221'])

    def test_ranges_3(self):
        data = [['AC008128', 73],['AC019221', 38],['AB040731', 52]]
        ranges = classify.thoseInRange(data, 0, 60)
        self.assertEqual(ranges,['AC019221','AB040731'])

if __name__ == '__main__':
    unittest.main()
