GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
test_split.TestSplit Class Reference
Inheritance diagram for test_split.TestSplit:
test_split.SplitSession test_book.BookSession

Public Member Functions

 test_memo (self)
 
 test_online_id (self)
 
 test_account (self)
 
 test_transaction (self)
 
 test_equal (self)
 
- Public Member Functions inherited from test_split.SplitSession
 setUp (self)
 
 tearDown (self)
 

Data Fields

 currency
 
 split
 
- Data Fields inherited from test_split.SplitSession
 split
 
- Data Fields inherited from test_book.BookSession
 ses
 
 book
 
 table
 
 currency
 

Detailed Description

Definition at line 17 of file test_split.py.

Member Function Documentation

◆ test_account()

test_split.TestSplit.test_account (   self)

Definition at line 37 of file test_split.py.

37 def test_account(self):
38 ACCT = Account(self.book)
39 ACCT.SetCommodity(self.currency)
40 self.split.SetAccount(ACCT)
41 self.assertTrue( ACCT.Equal(self.split.GetAccount(), True) )
42
STRUCTS.

◆ test_equal()

test_split.TestSplit.test_equal (   self)

Definition at line 70 of file test_split.py.

70 def test_equal(self):
71 COPY = self.split
72 self.assertTrue( self.split.Equal(COPY, True, False, False) )
73 # test __eq__ implementation
74 TRANS = Transaction(self.book)
75 self.split.SetParent(TRANS)
76 self.assertTrue( self.split == TRANS.GetSplitList()[0] )
77 self.assertTrue( self.split != Split(self.book) )
78

◆ test_memo()

test_split.TestSplit.test_memo (   self)

Definition at line 18 of file test_split.py.

18 def test_memo(self):
19 MEMO = "cookie monster"
20 self.assertEqual( '', self.split.GetMemo() )
21 self.split.SetMemo(MEMO)
22 self.assertEqual( MEMO, self.split.GetMemo() )
23

◆ test_online_id()

test_split.TestSplit.test_online_id (   self)

Definition at line 24 of file test_split.py.

24 def test_online_id(self):
25 FITID = "20240131-0001-1234567890"
26 # Unset online_id reads back as None (no KVP slot present).
27 self.assertEqual( None, self.split.GetOnlineID() )
28 self.assertFalse( self.split.HasOnlineID() )
29 self.split.SetOnlineID(FITID)
30 self.assertEqual( FITID, self.split.GetOnlineID() )
31 self.assertTrue( self.split.HasOnlineID() )
32 # Passing "" (or None) clears it.
33 self.split.SetOnlineID("")
34 self.assertEqual( None, self.split.GetOnlineID() )
35 self.assertFalse( self.split.HasOnlineID() )
36

◆ test_transaction()

test_split.TestSplit.test_transaction (   self)

Definition at line 43 of file test_split.py.

43 def test_transaction(self):
44 domain1 = "gnc.engine.scrub"
45 msg1 = "[xaccScrubUtilityGetOrMakeAccount()] No currency specified!"
46 level = G_LOG_LEVEL_CRITICAL
47 check1 = TestErrorStruct()
48 check1.log_domain = domain1
49 check1.log_level = level
50 check1.msg = msg1
51 hdlr1 = test_set_checked_handler(domain1, level, check1)
52 domain2 = "gnc.engine"
53 msg2 = "[xaccTransScrubSplits()] Transaction doesn't have a currency!"
54 level = G_LOG_LEVEL_CRITICAL
55 check2 = TestErrorStruct()
56 check2.log_domain = domain2
57 check2.log_level = level
58 check2.msg = msg2
59 hdlr2 = test_set_checked_handler(domain2, level, check2)
60
61 TRANS = Transaction(self.book)
62 self.split.SetParent(TRANS)
63 TRANS.SetCurrency(self.currency)
64 TRANS.SetDescription("Foo")
65 self.assertEqual( TRANS.GetDescription(), self.split.GetParent().GetDescription() )
66
67 g_log_remove_handler(domain2, hdlr2)
68 g_log_remove_handler(domain1, hdlr1)
69
Struct to pass as user_data for the handlers.

Field Documentation

◆ currency

test_split.TestSplit.currency

Definition at line 39 of file test_split.py.

◆ split

test_split.TestSplit.split

Definition at line 76 of file test_split.py.


The documentation for this class was generated from the following file: