def test_fail_on_dup_key_vals(self, mock_open):
    """Duplicate key vals should cause failure when approp. option not set."""
    out_strm = StringIO.StringIO()
    streams = {"out.dat": out_strm}
    mock_open.side_effect = build_mock_open_side_effect(self.strs, streams)
    args = ["-o", "out.dat", "-a", "BB", "-b", "BX", "one_dup_fields.dat",
            "two_hdr.dat"]
    self.assertRaises(DuplicateKeyError, _main, args, "join")
    args = ["-o", "out.dat", "-a", "BX", "-b", "BB", "two_hdr.dat",
            "one_dup_fields.dat"]
    self.assertRaises(DuplicateKeyError, _main, args, "join")
def test_fail_on_dup_key_vals ( self , mock_open ) : out_strm = StringIO . StringIO ( ) streams = { "out.dat" : out_strm } mock_open . side_effect = build_mock_open_side_effect ( self . strs , streams ) args = [ "-o" , "out.dat" , "-a" , "BB" , "-b" , "BX" , "one_dup_fields.dat" , "two_hdr.dat" ] self . assertRaises ( DuplicateKeyError , _main , args , "join" ) args = [ "-o" , "out.dat" , "-a" , "BX" , "-b" , "BB" , "two_hdr.dat" , "one_dup_fields.dat" ] self . assertRaises ( DuplicateKeyError , _main , args , "join" )
Duplicate key vals should cause failure when approp. option not set.