コード例 #1
0
 def test_combine_or_first_failure(self):
     """Test Result OR combinator"""
     result = combine_result_with_or(self.bad, self.good)
     self.assertEqual(result, self.good)
コード例 #2
0
 def test_combine_or_both_success(self):
     """Test Result OR combinator"""
     result = combine_result_with_or(self.good, self.good)
     self.assertEqual(result, self.good)
コード例 #3
0
 def test_combine_or_both_failure(self):
     """Test Result OR combinator"""
     result = combine_result_with_or(self.bad, self.alt_bad)
     self.assertEqual(
         result.payload, dict(self.bad.payload, **self.alt_bad.payload))
コード例 #4
0
 def test_combine_or_first_failure(self):
     """Test Result OR combinator"""
     result = combine_result_with_or(self.bad, self.good)
     self.assertEqual(result, self.good)
コード例 #5
0
 def test_combine_or_both_success(self):
     """Test Result OR combinator"""
     result = combine_result_with_or(self.good, self.good)
     self.assertEqual(result, self.good)
コード例 #6
0
 def test_combine_or_both_failure(self):
     """Test Result OR combinator"""
     result = combine_result_with_or(self.bad, self.alt_bad)
     self.assertEqual(result.payload,
                      dict(self.bad.payload, **self.alt_bad.payload))