mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-26 13:47:40 +00:00
Consistently rename response fields to CamelCase. #116
This commit is contained in:
+5
-5
@@ -302,9 +302,9 @@ func apiReposPackageFromDir(c *gin.Context) {
|
|||||||
packageFiles, failedFiles []string
|
packageFiles, failedFiles []string
|
||||||
processedFiles, failedFiles2 []string
|
processedFiles, failedFiles2 []string
|
||||||
reporter = &aptly.RecordingResultReporter{
|
reporter = &aptly.RecordingResultReporter{
|
||||||
Warnings: []string{},
|
Warnings: []string{},
|
||||||
Adds: []string{},
|
AddedLines: []string{},
|
||||||
Removes: []string{},
|
RemovedLines: []string{},
|
||||||
}
|
}
|
||||||
list *deb.PackageList
|
list *deb.PackageList
|
||||||
)
|
)
|
||||||
@@ -364,7 +364,7 @@ func apiReposPackageFromDir(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(200, gin.H{
|
c.JSON(200, gin.H{
|
||||||
"report": reporter,
|
"Report": reporter,
|
||||||
"failedFiles": failedFiles,
|
"FailedFiles": failedFiles,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -41,9 +41,9 @@ func (c *ConsoleResultReporter) Added(msg string, a ...interface{}) {
|
|||||||
|
|
||||||
// RecordingResultReporter is implementation of ResultReporter that collects all messages
|
// RecordingResultReporter is implementation of ResultReporter that collects all messages
|
||||||
type RecordingResultReporter struct {
|
type RecordingResultReporter struct {
|
||||||
Warnings []string `json:"warnings"`
|
Warnings []string
|
||||||
Adds []string `json:"added"`
|
AddedLines []string `json:"Added"`
|
||||||
Removes []string `json:"removed"`
|
RemovedLines []string `json:"Removed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check interface
|
// Check interface
|
||||||
@@ -58,10 +58,10 @@ func (r *RecordingResultReporter) Warning(msg string, a ...interface{}) {
|
|||||||
|
|
||||||
// Removed is signal that something has been removed
|
// Removed is signal that something has been removed
|
||||||
func (r *RecordingResultReporter) Removed(msg string, a ...interface{}) {
|
func (r *RecordingResultReporter) Removed(msg string, a ...interface{}) {
|
||||||
r.Removes = append(r.Removes, fmt.Sprintf(msg, a...))
|
r.RemovedLines = append(r.RemovedLines, fmt.Sprintf(msg, a...))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Added is signal that something has been added
|
// Added is signal that something has been added
|
||||||
func (r *RecordingResultReporter) Added(msg string, a ...interface{}) {
|
func (r *RecordingResultReporter) Added(msg string, a ...interface{}) {
|
||||||
r.Adds = append(r.Adds, fmt.Sprintf(msg, a...))
|
r.AddedLines = append(r.AddedLines, fmt.Sprintf(msg, a...))
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -63,11 +63,11 @@ class ReposAPITestAdd(APITest):
|
|||||||
resp = self.post("/api/repos/" + repo_name + "/file/" + d)
|
resp = self.post("/api/repos/" + repo_name + "/file/" + d)
|
||||||
self.check_equal(resp.status_code, 200)
|
self.check_equal(resp.status_code, 200)
|
||||||
self.check_equal(resp.json(), {
|
self.check_equal(resp.json(), {
|
||||||
u'failedFiles': [],
|
u'FailedFiles': [],
|
||||||
u'report': {
|
u'Report': {
|
||||||
u'added': [u'pyspi_0.6.1-1.3_source added'],
|
u'Added': [u'pyspi_0.6.1-1.3_source added'],
|
||||||
u'removed': [],
|
u'Removed': [],
|
||||||
u'warnings': []}})
|
u'Warnings': []}})
|
||||||
|
|
||||||
self.check_equal(self.get("/api/repos/" + repo_name + "/packages").json(), ['Psource pyspi 0.6.1-1.3 3a8b37cbd9a3559e'])
|
self.check_equal(self.get("/api/repos/" + repo_name + "/packages").json(), ['Psource pyspi 0.6.1-1.3 3a8b37cbd9a3559e'])
|
||||||
|
|
||||||
@@ -129,11 +129,11 @@ class ReposAPITestAddFile(APITest):
|
|||||||
resp = self.post("/api/repos/" + repo_name + "/file/" + d + "/libboost-program-options-dev_1.49.0.1_i386.deb")
|
resp = self.post("/api/repos/" + repo_name + "/file/" + d + "/libboost-program-options-dev_1.49.0.1_i386.deb")
|
||||||
self.check_equal(resp.status_code, 200)
|
self.check_equal(resp.status_code, 200)
|
||||||
self.check_equal(resp.json(), {
|
self.check_equal(resp.json(), {
|
||||||
u'failedFiles': [],
|
u'FailedFiles': [],
|
||||||
u'report': {
|
u'Report': {
|
||||||
u'added': [u'libboost-program-options-dev_1.49.0.1_i386 added'],
|
u'Added': [u'libboost-program-options-dev_1.49.0.1_i386 added'],
|
||||||
u'removed': [],
|
u'Removed': [],
|
||||||
u'warnings': []}})
|
u'Warnings': []}})
|
||||||
|
|
||||||
self.check_equal(self.get("/api/repos/" + repo_name + "/packages").json(),
|
self.check_equal(self.get("/api/repos/" + repo_name + "/packages").json(),
|
||||||
['Pi386 libboost-program-options-dev 1.49.0.1 918d2f433384e378'])
|
['Pi386 libboost-program-options-dev 1.49.0.1 918d2f433384e378'])
|
||||||
|
|||||||
Reference in New Issue
Block a user