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

NarratorTests   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %
Metric Value
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_File() 0 11 1
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