Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix unit tests for routing #4743

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/euclid/src/frontend/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ mod test {
let mut key_names: FxHashMap<DirKeyKind, String> = FxHashMap::default();

for key in DirKeyKind::iter() {
if matches!(key, DirKeyKind::Connector) {
continue;
}

let json_str = if let DirKeyKind::MetaData = key {
r#""metadata""#.to_string()
} else {
Expand Down
36 changes: 22 additions & 14 deletions crates/kgraph_utils/src/mca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,6 @@ mod tests {
api_enums::CardNetwork::Mastercard,
]),
accepted_currencies: Some(AcceptedCurrencies::EnableOnly(vec![
api_enums::Currency::USD,
api_enums::Currency::INR,
])),
accepted_countries: None,
Expand All @@ -734,7 +733,6 @@ mod tests {
]),
accepted_currencies: Some(AcceptedCurrencies::EnableOnly(vec![
api_enums::Currency::GBP,
api_enums::Currency::PHP,
])),
accepted_countries: None,
minimum_amount: Some(10),
Expand All @@ -752,14 +750,6 @@ mod tests {
status: api_enums::ConnectorStatus::Inactive,
};

let currency_country_flow_filter = kgraph_types::CurrencyCountryFlowFilter {
currency: Some(HashSet::from([api_enums::Currency::INR])),
country: Some(HashSet::from([api_enums::CountryAlpha2::IN])),
not_available_flows: Some(kgraph_types::NotAvailableFlows {
capture_method: Some(api_enums::CaptureMethod::Manual),
}),
};

let config_map = kgraph_types::CountryCurrencyFilter {
connector_configs: HashMap::from([(
api_enums::RoutableConnectors::Stripe,
Expand All @@ -768,13 +758,31 @@ mod tests {
kgraph_types::PaymentMethodFilterKey::PaymentMethodType(
api_enums::PaymentMethodType::Credit,
),
currency_country_flow_filter.clone(),
kgraph_types::CurrencyCountryFlowFilter {
currency: Some(HashSet::from([
api_enums::Currency::INR,
api_enums::Currency::USD,
])),
country: Some(HashSet::from([api_enums::CountryAlpha2::IN])),
not_available_flows: Some(kgraph_types::NotAvailableFlows {
capture_method: Some(api_enums::CaptureMethod::Manual),
}),
},
),
(
kgraph_types::PaymentMethodFilterKey::PaymentMethodType(
api_enums::PaymentMethodType::Debit,
),
currency_country_flow_filter,
kgraph_types::CurrencyCountryFlowFilter {
currency: Some(HashSet::from([
api_enums::Currency::GBP,
api_enums::Currency::PHP,
])),
country: Some(HashSet::from([api_enums::CountryAlpha2::IN])),
not_available_flows: Some(kgraph_types::NotAvailableFlows {
capture_method: Some(api_enums::CaptureMethod::Manual),
}),
},
),
])),
)]),
Expand Down Expand Up @@ -838,8 +846,8 @@ mod tests {
dirval!(Connector = Stripe),
dirval!(PaymentMethod = Card),
dirval!(CardType = Debit),
dirval!(CardNetwork = DinersClub),
dirval!(PaymentCurrency = GBP),
dirval!(CardNetwork = Maestro),
dirval!(PaymentCurrency = PHP),
dirval!(PaymentAmount = 100),
]),
&mut Memoization::new(),
Expand Down
Loading