Completed
Pull Request — master (#127)
by Jasper
01:07
created

NarratorTests.test_File()   A

Complexity

Conditions 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 11
rs 9.4285
1
import unittest
2
from mock import Mock
3
from datetime import datetime
4
5
6
class NarratorTests(unittest.TestCase):
7
8
    def test_File(self):
9
        from niprov.formatnarrated import NarratedFormat
10
        img = Mock()
11
        p = {}
12
        p['protocol'] = 'T1'
13
        p['acquired'] = datetime(2013, 9, 7, 11, 27, 34)
14
        p['subject'] = 'John Doe'
15
        p['size'] = 345123
16
        img.provenance = p
17
        storyteller = NarratedFormat()
18
        self.assertEqual(storyteller.serializeSingle(img), ("This is a T1 image. "
19
            "It was recorded September 7, 2013. "
20
            "The participant's name is John Doe. "
21
            "It is 345KB in size. "))
22
        
23